diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8680ed1..fbc25242d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # SEOmatic Changelog +## 4.0.1 - 2022.05.31 +### Added +* Added Schema.org v14 JSON-LD models, generated via [SchemaGen](https://github.com/nystudio107/schemagen) ([#1092](https://github.com/nystudio107/craft-seomatic/issues/1092)) + +### Changed +* Removed Bing from `SEARCH_ENGINE_SUBMISSION_URLS` due to it being deprecated ([#1043](https://github.com/nystudio107/craft-seomatic/issues/1043)) + +### Fixed +* Don't allow the autocomplete object inspection to recurse infinitely, set a cap of 10 levels deep ([#1132](https://github.com/nystudio107/craft-seomatic/issues/1132)) + +### Fixed +* Ensure the constant `Seomatic::SEOMATIC_PREVIEW_AUTHORIZATION_KEY` has `public` access + ## 4.0.0 - 2022.05.16 ### Added * Initial Craft CMS 4 release diff --git a/composer.json b/composer.json index 5f5415c4f..b344d499f 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nystudio107/craft-seomatic", "description": "SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.", "type": "craft-plugin", - "version": "4.0.0", + "version": "4.0.1", "keywords": [ "craft", "cms", diff --git a/src/Seomatic.php b/src/Seomatic.php index 1ec15047c..481a550e9 100644 --- a/src/Seomatic.php +++ b/src/Seomatic.php @@ -110,12 +110,12 @@ class Seomatic extends Plugin public const DEVMODE_CACHE_DURATION = 30; + public const SEOMATIC_PREVIEW_AUTHORIZATION_KEY = 'seomaticPreviewAuthorizationKey'; + protected const FRONTEND_SEO_FILE_LINK = 'seomatic/seo-file-link/////'; protected const FRONTEND_PREVIEW_PATH = 'seomatic/preview-social-media'; - protected const SEOMATIC_PREVIEW_AUTHORIZATION_KEY = 'seomaticPreviewAuthorizationKey'; - // Static Properties // ========================================================================= diff --git a/src/helpers/Autocomplete.php b/src/helpers/Autocomplete.php index 16f1f3f3d..bb4c9ce71 100644 --- a/src/helpers/Autocomplete.php +++ b/src/helpers/Autocomplete.php @@ -87,6 +87,8 @@ class Autocomplete 'Variable' => 4, ]; + const RECURSION_DEPTH_LIMIT = 10; + // Public Static Methods // ========================================================================= @@ -110,7 +112,7 @@ public static function generate($additionalCompletionsCacheKey = null): array $type = gettype($value); switch ($type) { case 'object': - self::parseObject($completionList, $key, $value); + self::parseObject($completionList, $key, $value, 0); break; case 'array': @@ -155,10 +157,16 @@ public static function generate($additionalCompletionsCacheKey = null): array * @param array $completionList * @param string $name * @param $object + * @param int $recursionDepth * @param string $path */ - public static function parseObject(array &$completionList, string $name, $object, string $path = '') + public static function parseObject(array &$completionList, string $name, $object, int $recursionDepth, string $path = '') { + // Only recurse `RECURSION_DEPTH_LIMIT` deep + if ($recursionDepth > self::RECURSION_DEPTH_LIMIT) { + return; + } + $recursionDepth++; // Create the docblock factory $factory = DocBlockFactory::createInstance(); @@ -166,13 +174,13 @@ public static function parseObject(array &$completionList, string $name, $object // The class itself self::getClassCompletion($completionList, $object, $factory, $name, $path); // ServiceLocator Components - self::getComponentCompletion($completionList, $object, $path); + self::getComponentCompletion($completionList, $object, $recursionDepth, $path); // Class properties - self::getPropertyCompletion($completionList, $object, $factory, $path); + self::getPropertyCompletion($completionList, $object, $factory, $recursionDepth, $path); // Class methods self::getMethodCompletion($completionList, $object, $factory, $path); // Behavior properties - self::getBehaviorCompletion($completionList, $object, $factory, $path); + self::getBehaviorCompletion($completionList, $object, $factory, $recursionDepth, $path); } // Protected Static Methods @@ -222,9 +230,10 @@ protected static function getClassCompletion(array &$completionList, $object, Do /** * @param array $completionList * @param $object + * @param $recursionDepth * @param $path */ - protected static function getComponentCompletion(array &$completionList, $object, $path) + protected static function getComponentCompletion(array &$completionList, $object, $recursionDepth, $path) { if ($object instanceof ServiceLocator) { foreach ($object->getComponents() as $key => $value) { @@ -235,7 +244,7 @@ protected static function getComponentCompletion(array &$completionList, $object // That's okay } if ($componentObject) { - self::parseObject($completionList, $key, $componentObject, $path); + self::parseObject($completionList, $key, $componentObject, $recursionDepth, $path); } } } @@ -247,7 +256,7 @@ protected static function getComponentCompletion(array &$completionList, $object * @param DocBlockFactory $factory * @param string $path */ - protected static function getPropertyCompletion(array &$completionList, $object, DocBlockFactory $factory, string $path) + protected static function getPropertyCompletion(array &$completionList, $object, DocBlockFactory $factory, $recursionDepth, string $path) { try { $reflectionClass = new ReflectionClass($object); @@ -347,7 +356,7 @@ protected static function getPropertyCompletion(array &$completionList, $object, // Recurse through if this is an object if (isset($object->$propertyName) && is_object($object->$propertyName)) { if (!$customField && !in_array($propertyName, self::EXCLUDED_PROPERTY_NAMES, true)) { - self::parseObject($completionList, $propertyName, $object->$propertyName, $path); + self::parseObject($completionList, $propertyName, $object->$propertyName, $recursionDepth, $path); } } } @@ -451,12 +460,12 @@ protected static function getMethodCompletion(array &$completionList, $object, D * @param DocBlockFactory $factory * @param string $path */ - protected static function getBehaviorCompletion(array &$completionList, $object, DocBlockFactory $factory, string $path) + protected static function getBehaviorCompletion(array &$completionList, $object, DocBlockFactory $factory, $recursionDepth, string $path) { if ($object instanceof Element) { $behaviorClass = $object->getBehavior('customFields'); if ($behaviorClass) { - self::getPropertyCompletion($completionList, $behaviorClass, $factory, $path); + self::getPropertyCompletion($completionList, $behaviorClass, $factory, $recursionDepth, $path); } } } diff --git a/src/models/MetaJsonLd.php b/src/models/MetaJsonLd.php index e42ab4b9e..2b012518c 100644 --- a/src/models/MetaJsonLd.php +++ b/src/models/MetaJsonLd.php @@ -49,105 +49,28 @@ class MetaJsonLd extends NonceItem * * @var string */ - static public $schemaTypeName = 'JsonLd'; + static public string $schemaTypeName = 'JsonLd'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/'; + static public string $schemaTypeScope = 'https://schema.org/'; /** * The Schema.org Type Description * * @var string */ - static public $schemaTypeDescription = 'Generic JsonLd type.'; + static public string $schemaTypeDescription = 'Generic JsonLd type.'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = ''; - - /** - * The Schema.org Property Names - * - * @var array - */ - static public $schemaPropertyNames = []; - - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; - - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; - - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static public $googleRequiredSchema = []; - - /** - * The Schema.org Google Recommended Schema for this type - * - * @var array - */ - static public $googleRecommendedSchema = []; - - // Static Protected Properties - // ========================================================================= - - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - ]; - - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - ]; - - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - ]; - - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; + static public string $schemaTypeExtends = ''; // Public Properties // ========================================================================= @@ -248,6 +171,57 @@ public function __toString() ]); } + /** + * Return the Schema.org Property Names + * + * @return array + */ + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } + + + /** + * Return the Schema.org Property Expected Types + * + * @return array + */ + public function getSchemaPropertyExpectedTypes(): array + { + return []; + } + + /** + * Return the Schema.org Property Descriptions + * + * @return array + */ + public function getSchemaPropertyDescriptions(): array + { + return []; + } + + /** + * Return the Schema.org Google Required Schema for this type + * + * @return array + */ + public function getGoogleRequiredSchema(): array + { + return []; + } + + /** + * Return the Schema.org Google Recommended Schema for this type + * + * @return array + */ + public function getGoogleRecommendedSchema(): array + { + return []; + } + /** * @inheritdoc */ @@ -388,10 +362,10 @@ public function validateJsonSchema( $params ) { - if (!in_array($attribute, static::$schemaPropertyNames, true)) { + if (!in_array($attribute, $this->getSchemaPropertyNames(), true)) { $this->addError($attribute, 'The attribute does not exist.'); } else { - $expectedTypes = static::$schemaPropertyExpectedTypes[$attribute]; + $expectedTypes = $this->getSchemaPropertyExpectedTypes()[$attribute]; $validated = false; $dataToValidate = $this->$attribute; if (!is_array($dataToValidate)) { diff --git a/src/models/jsonld/AMRadioChannel.php b/src/models/jsonld/AMRadioChannel.php index e33b6d448..5263ddefe 100644 --- a/src/models/jsonld/AMRadioChannel.php +++ b/src/models/jsonld/AMRadioChannel.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'broadcastChannelId' => ['Text'], + 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], + 'broadcastServiceTier' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'genre' => ['URL', 'Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inBroadcastLineup' => ['CableOrSatelliteService'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'providesBroadcastService' => ['BroadcastService'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'broadcastChannelId', - 'broadcastFrequency', - 'broadcastServiceTier', - 'genre', - 'inBroadcastLineup', - 'providesBroadcastService' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'broadcastChannelId' => ['Text'], - 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], - 'broadcastServiceTier' => ['Text'], - 'genre' => ['Text', 'URL'], - 'inBroadcastLineup' => ['CableOrSatelliteService'], - 'providesBroadcastService' => ['BroadcastService'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', - 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', - 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', - 'providesBroadcastService' => 'The BroadcastService offered on this channel. Inverse property: hasBroadcastChannel.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The unique address by which the BroadcastService can be identified in a - * provider lineup. In US, this is typically a number. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $broadcastChannelId; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', + 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', + 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', + 'description' => 'A description of the item.', + '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.', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'providesBroadcastService' => 'The BroadcastService offered on this channel.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The frequency used for over-the-air broadcasts. Numeric values or simple - * ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences - * of AM and FM radio channels, e.g. "87 FM". - * - * @var mixed|BroadcastFrequencySpecification|string [schema.org types: BroadcastFrequencySpecification, Text] - */ - public $broadcastFrequency; /** - * The type of service required to have access to the channel (e.g. Standard - * or Premium). - * - * @var string [schema.org types: Text] - */ - public $broadcastServiceTier; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * The CableOrSatelliteService offering the channel. - * - * @var CableOrSatelliteService [schema.org types: CableOrSatelliteService] - */ - public $inBroadcastLineup; - /** - * The BroadcastService offered on this channel. Inverse property: - * hasBroadcastChannel. - * - * @var BroadcastService [schema.org types: BroadcastService] + * @inheritdoc */ - public $providesBroadcastService; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['broadcastChannelId', 'broadcastFrequency', 'broadcastServiceTier', 'genre', 'inBroadcastLineup', 'providesBroadcastService'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AMRadioChannelInterface.php b/src/models/jsonld/AMRadioChannelInterface.php new file mode 100644 index 000000000..282efb5e1 --- /dev/null +++ b/src/models/jsonld/AMRadioChannelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assembly' => ['Text'], + 'assemblyVersion' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dependencies' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'executableLibraryName' => ['Text'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'proficiencyLevel' => ['Text'], + 'programmingModel' => ['Text'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'targetPlatform' => ['Text'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'assemblyVersion', - 'executableLibraryName', - 'programmingModel', - 'targetPlatform' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'assemblyVersion' => ['Text'], - 'executableLibraryName' => ['Text'], - 'programmingModel' => ['Text'], - 'targetPlatform' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'assemblyVersion' => 'Associated product/technology version. e.g., .NET Framework 4.5.', - 'executableLibraryName' => 'Library file name e.g., mscorlib.dll, system.web.dll. Supersedes assembly.', - 'programmingModel' => 'Indicates whether API is managed or unmanaged.', - 'targetPlatform' => 'Type of app development: phone, Metro style, desktop, XBox, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assembly' => 'Library file name e.g., mscorlib.dll, system.web.dll.', + 'assemblyVersion' => 'Associated product/technology version. e.g., .NET Framework 4.5.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dependencies' => 'Prerequisites needed to fulfill steps in article.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'executableLibraryName' => 'Library file name e.g., mscorlib.dll, system.web.dll.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'proficiencyLevel' => 'Proficiency needed for this content; expected values: \'Beginner\', \'Expert\'.', + 'programmingModel' => 'Indicates whether API is managed or unmanaged.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'targetPlatform' => 'Type of app development: phone, Metro style, desktop, XBox, etc.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Associated product/technology version. e.g., .NET Framework 4.5. - * - * @var string [schema.org types: Text] - */ - public $assemblyVersion; - /** - * Library file name e.g., mscorlib.dll, system.web.dll. Supersedes assembly. - * - * @var string [schema.org types: Text] - */ - public $executableLibraryName; - /** - * Indicates whether API is managed or unmanaged. - * - * @var string [schema.org types: Text] - */ - public $programmingModel; /** - * Type of app development: phone, Metro style, desktop, XBox, etc. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $targetPlatform; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['assemblyVersion', 'executableLibraryName', 'programmingModel', 'targetPlatform'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/APIReferenceInterface.php b/src/models/jsonld/APIReferenceInterface.php new file mode 100644 index 000000000..d2bdf4ed8 --- /dev/null +++ b/src/models/jsonld/APIReferenceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AbdomenInterface.php b/src/models/jsonld/AbdomenInterface.php new file mode 100644 index 000000000..7e9cefc48 --- /dev/null +++ b/src/models/jsonld/AbdomenInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AboutPageInterface.php b/src/models/jsonld/AboutPageInterface.php new file mode 100644 index 000000000..b5270ca98 --- /dev/null +++ b/src/models/jsonld/AboutPageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AcceptActionInterface.php b/src/models/jsonld/AcceptActionInterface.php new file mode 100644 index 000000000..b48fe4412 --- /dev/null +++ b/src/models/jsonld/AcceptActionInterface.php @@ -0,0 +1,24 @@ +dedicated document on the use of schema.org for + * marking up hotels and other forms of accommodations. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Accommodation + * @see https://schema.org/Accommodation */ -class Accommodation extends Place +class Accommodation extends MetaJsonLd implements AccommodationInterface, PlaceInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -37,308 +37,233 @@ class Accommodation extends Place * * @var string */ - static public $schemaTypeName = 'Accommodation'; + static public string $schemaTypeName = 'Accommodation'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Accommodation'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'An accommodation is a place that can accommodate human beings, e.g. a hotel room, a camping pitch, or a meeting room. Many accommodations are for overnight stays, but this is not a mandatory requirement. For more specific types of accommodations not defined in schema.org, one can use additionalType with external vocabularies. See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/Accommodation'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Place'; + static public string $schemaTypeExtends = 'Place'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<
+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use AccommodationTrait; + use PlaceTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationCategory' => ['Text'], + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'floorLevel' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'permittedUsage' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'], + 'yearBuilt' => ['Number'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accommodationCategory', - 'accommodationFloorPlan', - 'amenityFeature', - 'floorLevel', - 'floorSize', - 'leaseLength', - 'numberOfBathroomsTotal', - 'numberOfBedrooms', - 'numberOfFullBathrooms', - 'numberOfPartialBathrooms', - 'numberOfRooms', - 'permittedUsage', - 'petsAllowed', - 'tourBookingPage', - 'yearBuilt' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accommodationCategory' => ['Text'], - 'accommodationFloorPlan' => ['FloorPlan'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'floorLevel' => ['Text'], - 'floorSize' => ['QuantitativeValue'], - 'leaseLength' => ['Duration', 'QuantitativeValue'], - 'numberOfBathroomsTotal' => ['Integer'], - 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], - 'numberOfFullBathrooms' => ['Number'], - 'numberOfPartialBathrooms' => ['Number'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'permittedUsage' => ['Text'], - 'petsAllowed' => ['Boolean', 'Text'], - 'tourBookingPage' => ['URL'], - 'yearBuilt' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accommodationCategory' => 'Category of an Accommodation, following real estate conventions e.g. RESO (see PropertySubType, and PropertyType fields for suggested values).', - 'accommodationFloorPlan' => 'A floorplan of some Accommodation.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'floorLevel' => 'The floor level for an Accommodation in a multi-storey building. Since counting systems vary internationally, the local system should be used where possible.', - 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard', - 'leaseLength' => 'Length of the lease for some Accommodation, either particular to some Offer or in some cases intrinsic to the property.', - 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some Accommodation, following real estate conventions as documented in RESO: "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also numberOfRooms.', - 'numberOfBedrooms' => 'The total integer number of bedrooms in a some Accommodation, ApartmentComplex or FloorPlan.', - 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an Accommodation. This corresponds to the BathroomsFull field in RESO.', - 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an Accommodation. This corresponds to the BathroomsPartial field in RESO.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.', - 'yearBuilt' => 'The year an Accommodation was constructed. This corresponds to the YearBuilt field in RESO.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Category of an Accommodation, following real estate conventions e.g. RESO - * (see PropertySubType, and PropertyType fields for suggested values). - * - * @var string [schema.org types: Text] - */ - public $accommodationCategory; - /** - * A floorplan of some Accommodation. - * - * @var FloorPlan [schema.org types: FloorPlan] - */ - public $accommodationFloorPlan; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * The floor level for an Accommodation in a multi-storey building. Since - * counting systems vary internationally, the local system should be used - * where possible. - * - * @var string [schema.org types: Text] - */ - public $floorLevel; - /** - * The size of the accommodation, e.g. in square meter or squarefoot. Typical - * unit code(s): MTK for square meter, FTK for square foot, or YDK for square - * yard - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $floorSize; - /** - * Length of the lease for some Accommodation, either particular to some Offer - * or in some cases intrinsic to the property. - * - * @var mixed|Duration|QuantitativeValue [schema.org types: Duration, QuantitativeValue] - */ - public $leaseLength; - /** - * The total integer number of bathrooms in a some Accommodation, following - * real estate conventions as documented in RESO: "The simple sum of the - * number of bathrooms. For example for a property with two Full Bathrooms and - * one Half Bathroom, the Bathrooms Total Integer will be 3.". See also - * numberOfRooms. - * - * @var int [schema.org types: Integer] - */ - public $numberOfBathroomsTotal; - /** - * The total integer number of bedrooms in a some Accommodation, - * ApartmentComplex or FloorPlan. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfBedrooms; - /** - * Number of full bathrooms - The total number of full and ¾ bathrooms in an - * Accommodation. This corresponds to the BathroomsFull field in RESO. - * - * @var float [schema.org types: Number] - */ - public $numberOfFullBathrooms; - /** - * Number of partial bathrooms - The total number of half and ¼ bathrooms in - * an Accommodation. This corresponds to the BathroomsPartial field in RESO. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $numberOfPartialBathrooms; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationCategory' => 'Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values).', + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'floorLevel' => 'The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.', + 'yearBuilt' => 'The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). ' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; - /** - * Indications regarding the permitted usage of the accommodation. - * - * @var string [schema.org types: Text] - */ - public $permittedUsage; - /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] - */ - public $tourBookingPage; - /** - * The year an Accommodation was constructed. This corresponds to the - * YearBuilt field in RESO. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $yearBuilt; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accommodationCategory', 'accommodationFloorPlan', 'amenityFeature', 'floorLevel', 'floorSize', 'leaseLength', 'numberOfBathroomsTotal', 'numberOfBedrooms', 'numberOfFullBathrooms', 'numberOfPartialBathrooms', 'numberOfRooms', 'permittedUsage', 'petsAllowed', 'tourBookingPage', 'yearBuilt'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AccommodationInterface.php b/src/models/jsonld/AccommodationInterface.php new file mode 100644 index 000000000..20319ebad --- /dev/null +++ b/src/models/jsonld/AccommodationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'feesAndCommissionsSpecification' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'feesAndCommissionsSpecification' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Description of fees, commissions, and other terms applied either to a class - * of financial product, or by a financial service organization. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $feesAndCommissionsSpecification; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['feesAndCommissionsSpecification'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AccountingServiceInterface.php b/src/models/jsonld/AccountingServiceInterface.php new file mode 100644 index 000000000..342f9bac7 --- /dev/null +++ b/src/models/jsonld/AccountingServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AchieveActionInterface.php b/src/models/jsonld/AchieveActionInterface.php new file mode 100644 index 000000000..654121987 --- /dev/null +++ b/src/models/jsonld/AchieveActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ActionAccessSpecification.php b/src/models/jsonld/ActionAccessSpecification.php index d82d3b1d3..9d0f24fd7 100644 --- a/src/models/jsonld/ActionAccessSpecification.php +++ b/src/models/jsonld/ActionAccessSpecification.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'availabilityEnds' => ['Date', 'DateTime', 'Time'], + 'availabilityStarts' => ['Time', 'DateTime', 'Date'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleRegion' => ['GeoShape', 'Text', 'Place'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'availabilityEnds', - 'availabilityStarts', - 'category', - 'eligibleRegion', - 'expectsAcceptanceOf', - 'ineligibleRegion', - 'requiresSubscription' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'availabilityEnds' => ['Date', 'DateTime', 'Time'], - 'availabilityStarts' => ['Date', 'DateTime', 'Time'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'eligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'expectsAcceptanceOf' => ['Offer'], - 'ineligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'requiresSubscription' => ['Boolean', 'MediaSubscription'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', - 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also ineligibleRegion.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', - 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also eligibleRegion.', - 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are true or false (note that an earlier version had \'yes\', \'no\').' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The end of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] - */ - public $availabilityEnds; - /** - * The beginning of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] + * @inheritdoc */ - public $availabilityStarts; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', + 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also [[ineligibleRegion]]. ', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is valid. See also ineligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $eligibleRegion; /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] - */ - public $expectsAcceptanceOf; - /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is not valid, e.g. a region where the transaction is - * not allowed. See also eligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $ineligibleRegion; - /** - * Indicates if use of the media require a subscription (either paid or free). - * Allowed values are true or false (note that an earlier version had 'yes', - * 'no'). - * - * @var mixed|bool|MediaSubscription [schema.org types: Boolean, MediaSubscription] + * @inheritdoc */ - public $requiresSubscription; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['availabilityEnds', 'availabilityStarts', 'category', 'eligibleRegion', 'expectsAcceptanceOf', 'ineligibleRegion', 'requiresSubscription'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ActionAccessSpecificationInterface.php b/src/models/jsonld/ActionAccessSpecificationInterface.php new file mode 100644 index 000000000..c3b6560ff --- /dev/null +++ b/src/models/jsonld/ActionAccessSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ActionStatusTypeInterface.php b/src/models/jsonld/ActionStatusTypeInterface.php new file mode 100644 index 000000000..5bb1449bd --- /dev/null +++ b/src/models/jsonld/ActionStatusTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ActivateActionInterface.php b/src/models/jsonld/ActivateActionInterface.php new file mode 100644 index 000000000..904974926 --- /dev/null +++ b/src/models/jsonld/ActivateActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ActivationFeeInterface.php b/src/models/jsonld/ActivationFeeInterface.php new file mode 100644 index 000000000..9e331574f --- /dev/null +++ b/src/models/jsonld/ActivationFeeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ActiveActionStatusInterface.php b/src/models/jsonld/ActiveActionStatusInterface.php new file mode 100644 index 000000000..71b68446e --- /dev/null +++ b/src/models/jsonld/ActiveActionStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ActiveNotRecruitingInterface.php b/src/models/jsonld/ActiveNotRecruitingInterface.php new file mode 100644 index 000000000..ea62e93a8 --- /dev/null +++ b/src/models/jsonld/ActiveNotRecruitingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'collection' => ['Thing'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'targetCollection' => ['Thing'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'targetCollection' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'collection' => 'A sub property of object. The collection target of the action.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'targetCollection' => 'A sub property of object. The collection target of the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'targetCollection' => ['Thing'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'targetCollection' => 'A sub property of object. The collection target of the action. Supersedes collection.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of object. The collection target of the action. Supersedes - * collection. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $targetCollection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['targetCollection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AddActionInterface.php b/src/models/jsonld/AddActionInterface.php new file mode 100644 index 000000000..579890462 --- /dev/null +++ b/src/models/jsonld/AddActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AdministrativeAreaInterface.php b/src/models/jsonld/AdministrativeAreaInterface.php new file mode 100644 index 000000000..a6d168fdc --- /dev/null +++ b/src/models/jsonld/AdministrativeAreaInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AdultEntertainmentInterface.php b/src/models/jsonld/AdultEntertainmentInterface.php new file mode 100644 index 000000000..a40570857 --- /dev/null +++ b/src/models/jsonld/AdultEntertainmentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/AdultOrientedEnumerationInterface.php b/src/models/jsonld/AdultOrientedEnumerationInterface.php new file mode 100644 index 000000000..2aa24244f --- /dev/null +++ b/src/models/jsonld/AdultOrientedEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'articleBody', - 'articleSection', - 'backstory', - 'pageEnd', - 'pageStart', - 'pagination', - 'speakable', - 'wordCount' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'articleBody' => ['Text'], - 'articleSection' => ['Text'], - 'backstory' => ['CreativeWork', 'Text'], - 'pageEnd' => ['Integer', 'Text'], - 'pageStart' => ['Integer', 'Text'], - 'pagination' => ['Text'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'wordCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'articleBody' => 'The actual body of the article.', - 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', - 'backstory' => 'For an Article, typically a NewsArticle, the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', - 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', - 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', - 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'wordCount' => 'The number of words in the text of the Article.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The actual body of the article. - * - * @var string [schema.org types: Text] - */ - public $articleBody; - /** - * Articles may belong to one or more 'sections' in a magazine or newspaper, - * such as Sports, Lifestyle, etc. - * - * @var string [schema.org types: Text] - */ - public $articleSection; - /** - * For an Article, typically a NewsArticle, the backstory property provides a - * textual summary giving a brief explanation of why and how an article was - * created. In a journalistic setting this could include information about - * reporting process, methods, interviews, data sources, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] + * @inheritdoc */ - public $backstory; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The page on which the work ends; for example "138" or "xvi". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageEnd; - /** - * The page on which the work starts; for example "135" or "xiii". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageStart; - /** - * Any description of pages that is not separated into pageStart and pageEnd; - * for example, "1-6, 9, 55" or "10-12, 46-49". - * - * @var string [schema.org types: Text] - */ - public $pagination; /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * The number of words in the text of the Article. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $wordCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['articleBody', 'articleSection', 'backstory', 'pageEnd', 'pageStart', 'pagination', 'speakable', 'wordCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AdvertiserContentArticleInterface.php b/src/models/jsonld/AdvertiserContentArticleInterface.php new file mode 100644 index 000000000..e254bc621 --- /dev/null +++ b/src/models/jsonld/AdvertiserContentArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AerobicActivityInterface.php b/src/models/jsonld/AerobicActivityInterface.php new file mode 100644 index 000000000..a22eb988a --- /dev/null +++ b/src/models/jsonld/AerobicActivityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptedPaymentMethod' => ['LoanOrCredit', 'PaymentMethod'], + 'addOn' => ['Offer'], + 'additionalType' => ['URL'], + 'advanceBookingRequirement' => ['QuantitativeValue'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availability' => ['ItemAvailability'], + 'availabilityEnds' => ['Date', 'DateTime', 'Time'], + 'availabilityStarts' => ['Time', 'DateTime', 'Date'], + 'availableAtOrFrom' => ['Place'], + 'availableDeliveryMethod' => ['DeliveryMethod'], + 'businessFunction' => ['BusinessFunction'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'deliveryLeadTime' => ['QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleCustomerType' => ['BusinessEntityType'], + 'eligibleDuration' => ['QuantitativeValue'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleRegion' => ['GeoShape', 'Text', 'Place'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'highPrice' => ['Text', 'Number'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includesObject' => ['TypeAndQuantityNode'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'inventoryLevel' => ['QuantitativeValue'], + 'isFamilyFriendly' => ['Boolean'], + 'itemCondition' => ['OfferItemCondition'], + 'itemOffered' => ['Trip', 'Event', 'Product', 'AggregateOffer', 'CreativeWork', 'MenuItem', 'Service'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'lowPrice' => ['Text', 'Number'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'offerCount' => ['Integer'], + 'offeredBy' => ['Person', 'Organization'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'priceValidUntil' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seller' => ['Organization', 'Person'], + 'serialNumber' => ['Text'], + 'shippingDetails' => ['OfferShippingDetails'], + 'sku' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'warranty' => ['WarrantyPromise'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'highPrice', - 'lowPrice', - 'offerCount', - 'offers' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'highPrice' => ['Number', 'Text'], - 'lowPrice' => ['Number', 'Text'], - 'offerCount' => ['Integer'], - 'offers' => ['Demand', 'Offer'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'highPrice' => 'The highest price of all offers available. Usage guidelines: Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'lowPrice' => 'The lowest price of all offers available. Usage guidelines: Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'offerCount' => 'The number of offers for the product.', - '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. Inverse property: itemOffered.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptedPaymentMethod' => 'The payment method(s) accepted by seller for this offer.', + 'addOn' => 'An additional offer that can only be obtained in combination with the first base offer (e.g. supplements and extensions that are available for a surcharge).', + '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.', + 'advanceBookingRequirement' => 'The amount of time that is required between accepting the offer and the actual usage of the resource or service.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availability' => 'The availability of this item—for example In stock, Out of stock, Pre-order, etc.', + 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', + 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', + 'availableAtOrFrom' => 'The place(s) from which the offer can be obtained (e.g. store locations).', + 'availableDeliveryMethod' => 'The delivery method(s) available for this offer.', + 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'deliveryLeadTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup.', + 'description' => 'A description of the item.', + '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.', + 'eligibleCustomerType' => 'The type(s) of customers for which the given offer is valid.', + 'eligibleDuration' => 'The duration for which the given offer is valid.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also [[ineligibleRegion]]. ', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'highPrice' => 'The highest price of all offers available. Usage guidelines: * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in an [[Offer]] or [[ProductCollection]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'inventoryLevel' => 'The current approximate inventory level for the item or items.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + 'itemOffered' => 'An item being offered (or demanded). The transactional nature of the offer or demand is documented using [[businessFunction]], e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'lowPrice' => 'The lowest price of all offers available. Usage guidelines: * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + '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.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'offerCount' => 'The number of offers for the product.', + 'offeredBy' => 'A pointer to the organization or person making the offer.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + 'priceValidUntil' => 'The date after which the price is no longer available.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider.', + 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', + 'shippingDetails' => 'Indicates information about the shipping policies and options associated with an [[Offer]].', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'warranty' => 'The warranty promise(s) included in the offer.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The highest price of all offers available. Usage guidelines: Use values - * from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) - * rather than superficially similiar Unicode symbols. Use '.' (Unicode 'FULL - * STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using - * these symbols as a readability separator. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $highPrice; - /** - * The lowest price of all offers available. Usage guidelines: Use values from - * 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather - * than superficially similiar Unicode symbols. Use '.' (Unicode 'FULL STOP' - * (U+002E)) rather than ',' to indicate a decimal point. Avoid using these - * symbols as a readability separator. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $lowPrice; - /** - * The number of offers for the product. - * - * @var int [schema.org types: Integer] - */ - public $offerCount; /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] + * @inheritdoc */ - public $offers; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['highPrice', 'lowPrice', 'offerCount', 'offers'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AggregateOfferInterface.php b/src/models/jsonld/AggregateOfferInterface.php new file mode 100644 index 000000000..00a7ce9c6 --- /dev/null +++ b/src/models/jsonld/AggregateOfferInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'author' => ['Person', 'Organization'], + 'bestRating' => ['Text', 'Number'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itemReviewed' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'ratingCount' => ['Integer'], + 'ratingExplanation' => ['Text'], + 'ratingValue' => ['Number', 'Text'], + 'reviewAspect' => ['Text'], + 'reviewCount' => ['Integer'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'worstRating' => ['Text', 'Number'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemReviewed', - 'ratingCount', - 'reviewCount' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemReviewed' => ['Thing'], - 'ratingCount' => ['Integer'], - 'reviewCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'itemReviewed' => 'The item that is being reviewed/rated.', - 'ratingCount' => 'The count of total number of ratings.', - 'reviewCount' => 'The count of total number of reviews.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'bestRating' => 'The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'ratingCount' => 'The count of total number of ratings.', + 'ratingExplanation' => 'A short explanation (e.g. one to two sentences) providing background context and other information that led to the conclusion expressed in the rating. This is particularly applicable to ratings associated with "fact check" markup using [[ClaimReview]].', + 'ratingValue' => 'The rating for the content. Usage guidelines: * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewCount' => 'The count of total number of reviews.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'worstRating' => 'The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The item that is being reviewed/rated. - * - * @var Thing [schema.org types: Thing] - */ - public $itemReviewed; - /** - * The count of total number of ratings. - * - * @var int [schema.org types: Integer] - */ - public $ratingCount; /** - * The count of total number of reviews. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $reviewCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemReviewed', 'ratingCount', 'reviewCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AggregateRatingInterface.php b/src/models/jsonld/AggregateRatingInterface.php new file mode 100644 index 000000000..f4fcdab14 --- /dev/null +++ b/src/models/jsonld/AggregateRatingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AgreeActionInterface.php b/src/models/jsonld/AgreeActionInterface.php new file mode 100644 index 000000000..3fb6ad162 --- /dev/null +++ b/src/models/jsonld/AgreeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'boardingPolicy' => ['BoardingPolicyType'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'iataCode' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'boardingPolicy', - 'iataCode' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'boardingPolicy' => ['BoardingPolicyType'], - 'iataCode' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'boardingPolicy' => 'The type of boarding policy used by the airline (e.g. zone-based or group-based).', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'iataCode' => 'IATA identifier for an airline or airport.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'boardingPolicy' => 'The type of boarding policy used by the airline (e.g. zone-based or group-based).', - 'iataCode' => 'IATA identifier for an airline or airport.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The type of boarding policy used by the airline (e.g. zone-based or - * group-based). - * - * @var BoardingPolicyType [schema.org types: BoardingPolicyType] - */ - public $boardingPolicy; - /** - * IATA identifier for an airline or airport. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $iataCode; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['boardingPolicy', 'iataCode'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AirlineInterface.php b/src/models/jsonld/AirlineInterface.php new file mode 100644 index 000000000..f74b9e221 --- /dev/null +++ b/src/models/jsonld/AirlineInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'iataCode' => ['Text'], + 'icaoCode' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'iataCode', - 'icaoCode' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'iataCode' => ['Text'], - 'icaoCode' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'iataCode' => 'IATA identifier for an airline or airport.', + 'icaoCode' => 'ICAO identifier for an airport.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'iataCode' => 'IATA identifier for an airline or airport.', - 'icaoCode' => 'ICAO identifier for an airport.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * IATA identifier for an airline or airport. - * - * @var string [schema.org types: Text] - */ - public $iataCode; - /** - * ICAO identifier for an airport. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $icaoCode; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['iataCode', 'icaoCode'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AirportInterface.php b/src/models/jsonld/AirportInterface.php new file mode 100644 index 000000000..ec2fc73af --- /dev/null +++ b/src/models/jsonld/AirportInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AlbumReleaseInterface.php b/src/models/jsonld/AlbumReleaseInterface.php new file mode 100644 index 000000000..2d929a67b --- /dev/null +++ b/src/models/jsonld/AlbumReleaseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/AlcoholConsiderationInterface.php b/src/models/jsonld/AlcoholConsiderationInterface.php new file mode 100644 index 000000000..d8c6a2fa0 --- /dev/null +++ b/src/models/jsonld/AlcoholConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alignmentType' => ['Text'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'educationalFramework' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'targetDescription' => ['Text'], + 'targetName' => ['Text'], + 'targetUrl' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'alignmentType', - 'educationalFramework', - 'targetDescription', - 'targetName', - 'targetUrl' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'alignmentType' => ['Text'], - 'educationalFramework' => ['Text'], - 'targetDescription' => ['Text'], - 'targetName' => ['Text'], - 'targetUrl' => ['URL'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'alignmentType' => 'A category of alignment between the learning resource and the framework node. Recommended values include: \'assesses\', \'teaches\', \'requires\', \'textComplexity\', \'readingLevel\', \'educationalSubject\', and \'educationalLevel\'.', - 'educationalFramework' => 'The framework to which the resource being described is aligned.', - 'targetDescription' => 'The description of a node in an established educational framework.', - 'targetName' => 'The name of a node in an established educational framework.', - 'targetUrl' => 'The URL of a node in an established educational framework.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alignmentType' => 'A category of alignment between the learning resource and the framework node. Recommended values include: \'requires\', \'textComplexity\', \'readingLevel\', and \'educationalSubject\'.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'educationalFramework' => 'The framework to which the resource being described is aligned.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'targetDescription' => 'The description of a node in an established educational framework.', + 'targetName' => 'The name of a node in an established educational framework.', + 'targetUrl' => 'The URL of a node in an established educational framework.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A category of alignment between the learning resource and the framework - * node. Recommended values include: 'assesses', 'teaches', 'requires', - * 'textComplexity', 'readingLevel', 'educationalSubject', and - * 'educationalLevel'. - * - * @var string [schema.org types: Text] - */ - public $alignmentType; - /** - * The framework to which the resource being described is aligned. - * - * @var string [schema.org types: Text] - */ - public $educationalFramework; - /** - * The description of a node in an established educational framework. - * - * @var string [schema.org types: Text] - */ - public $targetDescription; - /** - * The name of a node in an established educational framework. - * - * @var string [schema.org types: Text] - */ - public $targetName; - /** - * The URL of a node in an established educational framework. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $targetUrl; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['alignmentType', 'educationalFramework', 'targetDescription', 'targetName', 'targetUrl'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AlignmentObjectInterface.php b/src/models/jsonld/AlignmentObjectInterface.php new file mode 100644 index 000000000..d4fd483b5 --- /dev/null +++ b/src/models/jsonld/AlignmentObjectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AllWheelDriveConfigurationInterface.php b/src/models/jsonld/AllWheelDriveConfigurationInterface.php new file mode 100644 index 000000000..bbb649848 --- /dev/null +++ b/src/models/jsonld/AllWheelDriveConfigurationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/AllergiesHealthAspectInterface.php b/src/models/jsonld/AllergiesHealthAspectInterface.php new file mode 100644 index 000000000..55017ff69 --- /dev/null +++ b/src/models/jsonld/AllergiesHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AllocateActionInterface.php b/src/models/jsonld/AllocateActionInterface.php new file mode 100644 index 000000000..8eb20759a --- /dev/null +++ b/src/models/jsonld/AllocateActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/AmpStoryInterface.php b/src/models/jsonld/AmpStoryInterface.php new file mode 100644 index 000000000..fcd5333f3 --- /dev/null +++ b/src/models/jsonld/AmpStoryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AmusementParkInterface.php b/src/models/jsonld/AmusementParkInterface.php new file mode 100644 index 000000000..f18482e25 --- /dev/null +++ b/src/models/jsonld/AmusementParkInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AnaerobicActivityInterface.php b/src/models/jsonld/AnaerobicActivityInterface.php new file mode 100644 index 000000000..acfd496b5 --- /dev/null +++ b/src/models/jsonld/AnaerobicActivityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dateline' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'printColumn' => ['Text'], + 'printEdition' => ['Text'], + 'printPage' => ['Text'], + 'printSection' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dateline', - 'printColumn', - 'printEdition', - 'printPage', - 'printSection' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dateline' => ['Text'], - 'printColumn' => ['Text'], - 'printEdition' => ['Text'], - 'printPage' => ['Text'], - 'printSection' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dateline' => 'A dateline is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using locationCreated (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use contentLocation. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines".', - 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', - 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', - 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', - 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dateline' => 'A [dateline](https://en.wikipedia.org/wiki/Dateline) is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using [[locationCreated]] (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use [[contentLocation]]. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines". ', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', + 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', + 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', + 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A dateline is a brief piece of text included in news articles that - * describes where and when the story was written or filed though the date is - * often omitted. Sometimes only a placename is provided. Structured - * representations of dateline-related information can also be expressed more - * explicitly using locationCreated (which represents where a work was created - * e.g. where a news report was written). For location depicted or described - * in the content, use contentLocation. Dateline summaries are oriented more - * towards human readers than towards automated processing, and can vary - * substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", - * "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", - * "QUEZON CITY, Philippines". - * - * @var string [schema.org types: Text] - */ - public $dateline; - /** - * The number of the column in which the NewsArticle appears in the print - * edition. - * - * @var string [schema.org types: Text] - */ - public $printColumn; - /** - * The edition of the print product in which the NewsArticle appears. - * - * @var string [schema.org types: Text] - */ - public $printEdition; - /** - * If this NewsArticle appears in print, this field indicates the name of the - * page on which the article is found. Please note that this field is intended - * for the exact page name (e.g. A5, B18). - * - * @var string [schema.org types: Text] - */ - public $printPage; - /** - * If this NewsArticle appears in print, this field indicates the print - * section in which the article appeared. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $printSection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dateline', 'printColumn', 'printEdition', 'printPage', 'printSection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AnalysisNewsArticleInterface.php b/src/models/jsonld/AnalysisNewsArticleInterface.php new file mode 100644 index 000000000..85a9adf05 --- /dev/null +++ b/src/models/jsonld/AnalysisNewsArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedPathophysiology', - 'bodyLocation', - 'connectedTo', - 'diagram', - 'partOfSystem', - 'relatedCondition', - 'relatedTherapy', - 'subStructure' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedPathophysiology' => ['Text'], - 'bodyLocation' => ['Text'], - 'connectedTo' => ['AnatomicalStructure'], - 'diagram' => ['ImageObject'], - 'partOfSystem' => ['AnatomicalSystem'], - 'relatedCondition' => ['MedicalCondition'], - 'relatedTherapy' => ['MedicalTherapy'], - 'subStructure' => ['AnatomicalStructure'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', - 'bodyLocation' => 'Location in the body of the anatomical structure.', - 'connectedTo' => 'Other anatomical structures to which this structure is connected.', - 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', - 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', - 'relatedCondition' => 'A medical condition associated with this anatomy.', - 'relatedTherapy' => 'A medical therapy related to this anatomy.', - 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * If applicable, a description of the pathophysiology associated with the - * anatomical system, including potential abnormal changes in the mechanical, - * physical, and biochemical functions of the system. - * - * @var string [schema.org types: Text] - */ - public $associatedPathophysiology; - /** - * Location in the body of the anatomical structure. - * - * @var string [schema.org types: Text] - */ - public $bodyLocation; - /** - * Other anatomical structures to which this structure is connected. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $connectedTo; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * An image containing a diagram that illustrates the structure and/or its - * component substructures and/or connections with other structures. - * - * @var ImageObject [schema.org types: ImageObject] - */ - public $diagram; - /** - * The anatomical or organ system that this structure is part of. - * - * @var AnatomicalSystem [schema.org types: AnatomicalSystem] - */ - public $partOfSystem; - /** - * A medical condition associated with this anatomy. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $relatedCondition; /** - * A medical therapy related to this anatomy. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $relatedTherapy; - /** - * Component (sub-)structure(s) that comprise this anatomical structure. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $subStructure; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedPathophysiology', 'bodyLocation', 'connectedTo', 'diagram', 'partOfSystem', 'relatedCondition', 'relatedTherapy', 'subStructure'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AnatomicalStructureInterface.php b/src/models/jsonld/AnatomicalStructureInterface.php new file mode 100644 index 000000000..5eabe90a6 --- /dev/null +++ b/src/models/jsonld/AnatomicalStructureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'code' => ['MedicalCode'], + 'comprisedOf' => ['AnatomicalStructure', 'AnatomicalSystem'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedStructure' => ['AnatomicalStructure'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedPathophysiology', - 'comprisedOf', - 'relatedCondition', - 'relatedStructure', - 'relatedTherapy' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedPathophysiology' => ['Text'], - 'comprisedOf' => ['AnatomicalStructure', 'AnatomicalSystem'], - 'relatedCondition' => ['MedicalCondition'], - 'relatedStructure' => ['AnatomicalStructure'], - 'relatedTherapy' => ['MedicalTherapy'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', - 'comprisedOf' => 'Specifying something physically contained by something else. Typically used here for the underlying anatomical structures, such as organs, that comprise the anatomical system.', - 'relatedCondition' => 'A medical condition associated with this anatomy.', - 'relatedStructure' => 'Related anatomical structure(s) that are not part of the system but relate or connect to it, such as vascular bundles associated with an organ system.', - 'relatedTherapy' => 'A medical therapy related to this anatomy.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'comprisedOf' => 'Specifying something physically contained by something else. Typically used here for the underlying anatomical structures, such as organs, that comprise the anatomical system.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedStructure' => 'Related anatomical structure(s) that are not part of the system but relate or connect to it, such as vascular bundles associated with an organ system.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * If applicable, a description of the pathophysiology associated with the - * anatomical system, including potential abnormal changes in the mechanical, - * physical, and biochemical functions of the system. - * - * @var string [schema.org types: Text] - */ - public $associatedPathophysiology; - /** - * Specifying something physically contained by something else. Typically used - * here for the underlying anatomical structures, such as organs, that - * comprise the anatomical system. - * - * @var mixed|AnatomicalStructure|AnatomicalSystem [schema.org types: AnatomicalStructure, AnatomicalSystem] - */ - public $comprisedOf; - /** - * A medical condition associated with this anatomy. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $relatedCondition; - /** - * Related anatomical structure(s) that are not part of the system but relate - * or connect to it, such as vascular bundles associated with an organ system. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] - */ - public $relatedStructure; - /** - * A medical therapy related to this anatomy. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] + * @inheritdoc */ - public $relatedTherapy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedPathophysiology', 'comprisedOf', 'relatedCondition', 'relatedStructure', 'relatedTherapy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AnatomicalSystemInterface.php b/src/models/jsonld/AnatomicalSystemInterface.php new file mode 100644 index 000000000..9e363f091 --- /dev/null +++ b/src/models/jsonld/AnatomicalSystemInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/AndroidPlatformInterface.php b/src/models/jsonld/AndroidPlatformInterface.php new file mode 100644 index 000000000..3b6b08228 --- /dev/null +++ b/src/models/jsonld/AndroidPlatformInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AnesthesiaInterface.php b/src/models/jsonld/AnesthesiaInterface.php new file mode 100644 index 000000000..50c948425 --- /dev/null +++ b/src/models/jsonld/AnesthesiaInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AnimalShelterInterface.php b/src/models/jsonld/AnimalShelterInterface.php new file mode 100644 index 000000000..76e1181d0 --- /dev/null +++ b/src/models/jsonld/AnimalShelterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'answerExplanation' => ['WebContent', 'Comment'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'downvoteCount' => ['Integer'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'parentItem' => ['Comment'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'upvoteCount' => ['Integer'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'downvoteCount', - 'parentItem', - 'upvoteCount' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'downvoteCount' => ['Integer'], - 'parentItem' => ['Question'], - 'upvoteCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'downvoteCount' => 'The number of downvotes this question, answer or comment has received from the community.', - 'parentItem' => 'The parent of a question, answer or item in general.', - 'upvoteCount' => 'The number of upvotes this question, answer or comment has received from the community.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'answerExplanation' => 'A step-by-step or full explanation about Answer. Can outline how this Answer was achieved or contain more broad clarification or statement about it. ', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'downvoteCount' => 'The number of downvotes this question, answer or comment has received from the community.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'parentItem' => 'The parent of a question, answer or item in general.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'upvoteCount' => 'The number of upvotes this question, answer or comment has received from the community.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of downvotes this question, answer or comment has received from - * the community. - * - * @var int [schema.org types: Integer] - */ - public $downvoteCount; - /** - * The parent of a question, answer or item in general. - * - * @var Question [schema.org types: Question] - */ - public $parentItem; /** - * The number of upvotes this question, answer or comment has received from - * the community. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $upvoteCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['downvoteCount', 'parentItem', 'upvoteCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AnswerInterface.php b/src/models/jsonld/AnswerInterface.php new file mode 100644 index 000000000..6bcd458b1 --- /dev/null +++ b/src/models/jsonld/AnswerInterface.php @@ -0,0 +1,24 @@ +http://en.wikipedia.org/wiki/Apartment). * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Apartment + * @see https://schema.org/Apartment */ -class Apartment extends Accommodation +class Apartment extends MetaJsonLd implements ApartmentInterface, AccommodationInterface, PlaceInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -34,175 +35,233 @@ class Apartment extends Accommodation * * @var string */ - static public $schemaTypeName = 'Apartment'; + static public string $schemaTypeName = 'Apartment'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Apartment'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'An apartment (in American English) or flat (in British English) is a self-contained housing unit (a type of residential real estate) that occupies only part of a building (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Apartment).'; + static public string $schemaTypeScope = 'https://schema.org/Apartment'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Accommodation'; + static public string $schemaTypeExtends = 'Accommodation'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<http://en.wikipedia.org/wiki/Apartment). +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use ApartmentTrait; + use AccommodationTrait; + use PlaceTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationCategory' => ['Text'], + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'floorLevel' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'occupancy' => ['QuantitativeValue'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'permittedUsage' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'], + 'yearBuilt' => ['Number'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'numberOfRooms', - 'occupancy' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'occupancy' => ['QuantitativeValue'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationCategory' => 'Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values).', + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'floorLevel' => 'The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'occupancy' => 'The allowed total occupancy for the accommodation in persons (including infants etc). For individual accommodations, this is not necessarily the legal maximum but defines the permitted usage as per the contractual agreement (e.g. a double room used by a single person). Typical unit code(s): C62 for person', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.', + 'yearBuilt' => 'The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). ' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'occupancy' => 'The allowed total occupancy for the accommodation in persons (including infants etc). For individual accommodations, this is not necessarily the legal maximum but defines the permitted usage as per the contractual agreement (e.g. a double room used by a single person). Typical unit code(s): C62 for person' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; - /** - * The allowed total occupancy for the accommodation in persons (including - * infants etc). For individual accommodations, this is not necessarily the - * legal maximum but defines the permitted usage as per the contractual - * agreement (e.g. a double room used by a single person). Typical unit - * code(s): C62 for person - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $occupancy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['numberOfRooms', 'occupancy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ApartmentComplex.php b/src/models/jsonld/ApartmentComplex.php index 9f8ec93c6..795023438 100644 --- a/src/models/jsonld/ApartmentComplex.php +++ b/src/models/jsonld/ApartmentComplex.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfAccommodationUnits' => ['QuantitativeValue'], + 'numberOfAvailableAccommodationUnits' => ['QuantitativeValue'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'numberOfAccommodationUnits', - 'numberOfAvailableAccommodationUnits', - 'numberOfBedrooms', - 'petsAllowed', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'numberOfAccommodationUnits' => ['QuantitativeValue'], - 'numberOfAvailableAccommodationUnits' => ['QuantitativeValue'], - 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], - 'petsAllowed' => ['Boolean', 'Text'], - 'tourBookingPage' => ['URL'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'numberOfAccommodationUnits' => 'Indicates the total (available plus unavailable) number of accommodation units in an ApartmentComplex, or the number of accommodation units for a specific FloorPlan (within its specific ApartmentComplex). See also numberOfAvailableAccommodationUnits.', - 'numberOfAvailableAccommodationUnits' => 'Indicates the number of available accommodation units in an ApartmentComplex, or the number of accommodation units for a specific FloorPlan (within its specific ApartmentComplex). See also numberOfAccommodationUnits.', - 'numberOfBedrooms' => 'The total integer number of bedrooms in a some Accommodation, ApartmentComplex or FloorPlan.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfAccommodationUnits' => 'Indicates the total (available plus unavailable) number of accommodation units in an [[ApartmentComplex]], or the number of accommodation units for a specific [[FloorPlan]] (within its specific [[ApartmentComplex]]). See also [[numberOfAvailableAccommodationUnits]].', + 'numberOfAvailableAccommodationUnits' => 'Indicates the number of available accommodation units in an [[ApartmentComplex]], or the number of accommodation units for a specific [[FloorPlan]] (within its specific [[ApartmentComplex]]). See also [[numberOfAccommodationUnits]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * Indicates the total (available plus unavailable) number of accommodation - * units in an ApartmentComplex, or the number of accommodation units for a - * specific FloorPlan (within its specific ApartmentComplex). See also - * numberOfAvailableAccommodationUnits. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfAccommodationUnits; - /** - * Indicates the number of available accommodation units in an - * ApartmentComplex, or the number of accommodation units for a specific - * FloorPlan (within its specific ApartmentComplex). See also - * numberOfAccommodationUnits. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfAvailableAccommodationUnits; - /** - * The total integer number of bedrooms in a some Accommodation, - * ApartmentComplex or FloorPlan. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfBedrooms; - /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; - /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['numberOfAccommodationUnits', 'numberOfAvailableAccommodationUnits', 'numberOfBedrooms', 'petsAllowed', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ApartmentComplexInterface.php b/src/models/jsonld/ApartmentComplexInterface.php new file mode 100644 index 000000000..a88775b62 --- /dev/null +++ b/src/models/jsonld/ApartmentComplexInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AppearanceInterface.php b/src/models/jsonld/AppearanceInterface.php new file mode 100644 index 000000000..1b07be5a0 --- /dev/null +++ b/src/models/jsonld/AppearanceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'collection' => ['Thing'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'targetCollection' => ['Thing'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'toLocation' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'collection' => 'A sub property of object. The collection target of the action.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'targetCollection' => 'A sub property of object. The collection target of the action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'toLocation' => ['Place'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AppendActionInterface.php b/src/models/jsonld/AppendActionInterface.php new file mode 100644 index 000000000..ba347c49a --- /dev/null +++ b/src/models/jsonld/AppendActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ApplyActionInterface.php b/src/models/jsonld/ApplyActionInterface.php new file mode 100644 index 000000000..561bd81df --- /dev/null +++ b/src/models/jsonld/ApplyActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'code', - 'guideline', - 'legalStatus', - 'medicineSystem', - 'recognizingAuthority', - 'relevantSpecialty', - 'study' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'code' => ['MedicalCode'], - 'guideline' => ['MedicalGuideline'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'medicineSystem' => ['MedicineSystem'], - 'recognizingAuthority' => ['Organization'], - 'relevantSpecialty' => ['MedicalSpecialty'], - 'study' => ['MedicalStudy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', - 'guideline' => 'A medical guideline related to this entity.', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', - 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', - 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', - 'study' => 'A medical study or trial related to this entity.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical code for the entity, taken from a controlled vocabulary or - * ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. - * - * @var MedicalCode [schema.org types: MedicalCode] - */ - public $code; - /** - * A medical guideline related to this entity. - * - * @var MedicalGuideline [schema.org types: MedicalGuideline] + * @inheritdoc */ - public $guideline; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The system of medicine that includes this MedicalEntity, for example - * 'evidence-based', 'homeopathic', 'chiropractic', etc. - * - * @var MedicineSystem [schema.org types: MedicineSystem] - */ - public $medicineSystem; - /** - * If applicable, the organization that officially recognizes this entity as - * part of its endorsed system of medicine. - * - * @var Organization [schema.org types: Organization] - */ - public $recognizingAuthority; - /** - * If applicable, a medical specialty in which this entity is relevant. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] - */ - public $relevantSpecialty; /** - * A medical study or trial related to this entity. - * - * @var MedicalStudy [schema.org types: MedicalStudy] + * @inheritdoc */ - public $study; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['code', 'guideline', 'legalStatus', 'medicineSystem', 'recognizingAuthority', 'relevantSpecialty', 'study'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ApprovedIndicationInterface.php b/src/models/jsonld/ApprovedIndicationInterface.php new file mode 100644 index 000000000..4afb6a085 --- /dev/null +++ b/src/models/jsonld/ApprovedIndicationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AquariumInterface.php b/src/models/jsonld/AquariumInterface.php new file mode 100644 index 000000000..f3f5041d3 --- /dev/null +++ b/src/models/jsonld/AquariumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'holdingArchive' => ['ArchiveOrganization'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'itemLocation' => ['Place', 'Text', 'PostalAddress'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'holdingArchive', - 'itemLocation' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'holdingArchive' => ['ArchiveOrganization'], - 'itemLocation' => ['Place', 'PostalAddress', 'Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'holdingArchive' => '[[ArchiveOrganization]] that holds, keeps or maintains the [[ArchiveComponent]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'itemLocation' => 'Current location of the item.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'holdingArchive' => 'ArchiveOrganization that holds, keeps or maintains the ArchiveComponent. Inverse property: archiveHeld.', - 'itemLocation' => 'Current location of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * ArchiveOrganization that holds, keeps or maintains the ArchiveComponent. - * Inverse property: archiveHeld. - * - * @var ArchiveOrganization [schema.org types: ArchiveOrganization] - */ - public $holdingArchive; - /** - * Current location of the item. - * - * @var mixed|Place|PostalAddress|string [schema.org types: Place, PostalAddress, Text] + * @inheritdoc */ - public $itemLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['holdingArchive', 'itemLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ArchiveComponentInterface.php b/src/models/jsonld/ArchiveComponentInterface.php new file mode 100644 index 000000000..871fe173e --- /dev/null +++ b/src/models/jsonld/ArchiveComponentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'archiveHeld' => ['ArchiveComponent'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'archiveHeld' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'archiveHeld' => 'Collection, [fonds](https://en.wikipedia.org/wiki/Fonds), or item held, kept or maintained by an [[ArchiveOrganization]].', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'archiveHeld' => ['ArchiveComponent'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'archiveHeld' => 'Collection, fonds, or item held, kept or maintained by an ArchiveOrganization. Inverse property: holdingArchive.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Collection, fonds, or item held, kept or maintained by an - * ArchiveOrganization. Inverse property: holdingArchive. - * - * @var ArchiveComponent [schema.org types: ArchiveComponent] + * @inheritdoc */ - public $archiveHeld; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['archiveHeld'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ArchiveOrganizationInterface.php b/src/models/jsonld/ArchiveOrganizationInterface.php new file mode 100644 index 000000000..1977199fe --- /dev/null +++ b/src/models/jsonld/ArchiveOrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'fromLocation', - 'toLocation' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'fromLocation' => ['Place'], - 'toLocation' => ['Place'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The original location of the object or the - * agent before the action. - * - * @var Place [schema.org types: Place] - */ - public $fromLocation; - /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['fromLocation', 'toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ArriveActionInterface.php b/src/models/jsonld/ArriveActionInterface.php new file mode 100644 index 000000000..54d4341a3 --- /dev/null +++ b/src/models/jsonld/ArriveActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ArtGalleryInterface.php b/src/models/jsonld/ArtGalleryInterface.php new file mode 100644 index 000000000..5952736b6 --- /dev/null +++ b/src/models/jsonld/ArtGalleryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'arterialBranch' => ['AnatomicalStructure'], + 'associatedPathophysiology' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supplyTo' => ['AnatomicalStructure'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'arterialBranch', - 'supplyTo' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'arterialBranch' => ['AnatomicalStructure'], - 'supplyTo' => ['AnatomicalStructure'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'arterialBranch' => 'The branches that comprise the arterial structure.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supplyTo' => 'The area to which the artery supplies blood.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'arterialBranch' => 'The branches that comprise the arterial structure. Supersedes branch.', - 'supplyTo' => 'The area to which the artery supplies blood.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The branches that comprise the arterial structure. Supersedes branch. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] - */ - public $arterialBranch; - /** - * The area to which the artery supplies blood. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $supplyTo; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['arterialBranch', 'supplyTo'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ArteryInterface.php b/src/models/jsonld/ArteryInterface.php new file mode 100644 index 000000000..6a39cd50a --- /dev/null +++ b/src/models/jsonld/ArteryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'articleBody', - 'articleSection', - 'backstory', - 'pageEnd', - 'pageStart', - 'pagination', - 'speakable', - 'wordCount' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'articleBody' => ['Text'], - 'articleSection' => ['Text'], - 'backstory' => ['CreativeWork', 'Text'], - 'pageEnd' => ['Integer', 'Text'], - 'pageStart' => ['Integer', 'Text'], - 'pagination' => ['Text'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'wordCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'articleBody' => 'The actual body of the article.', - 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', - 'backstory' => 'For an Article, typically a NewsArticle, the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', - 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', - 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', - 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'wordCount' => 'The number of words in the text of the Article.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - 'author', - 'datePublished', - 'headline', - 'image', - 'publisher' - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - 'dateModified', - 'mainEntityOfPage' - ]; - /** - * The actual body of the article. - * - * @var string [schema.org types: Text] - */ - public $articleBody; - /** - * Articles may belong to one or more 'sections' in a magazine or newspaper, - * such as Sports, Lifestyle, etc. - * - * @var string [schema.org types: Text] - */ - public $articleSection; - /** - * For an Article, typically a NewsArticle, the backstory property provides a - * textual summary giving a brief explanation of why and how an article was - * created. In a journalistic setting this could include information about - * reporting process, methods, interviews, data sources, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] + * @inheritdoc */ - public $backstory; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The page on which the work ends; for example "138" or "xvi". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageEnd; - /** - * The page on which the work starts; for example "135" or "xiii". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageStart; - /** - * Any description of pages that is not separated into pageStart and pageEnd; - * for example, "1-6, 9, 55" or "10-12, 46-49". - * - * @var string [schema.org types: Text] - */ - public $pagination; /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * The number of words in the text of the Article. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $wordCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['articleBody', 'articleSection', 'backstory', 'pageEnd', 'pageStart', 'pagination', 'speakable', 'wordCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ArticleInterface.php b/src/models/jsonld/ArticleInterface.php new file mode 100644 index 000000000..bfe085580 --- /dev/null +++ b/src/models/jsonld/ArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'question' => ['Question'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'question' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'question' => 'A sub property of object. A question.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'question' => ['Question'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'question' => 'A sub property of object. A question.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of object. A question. - * - * @var Question [schema.org types: Question] + * @inheritdoc */ - public $question; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['question'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AskActionInterface.php b/src/models/jsonld/AskActionInterface.php new file mode 100644 index 000000000..ef73d5edd --- /dev/null +++ b/src/models/jsonld/AskActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dateline' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'printColumn' => ['Text'], + 'printEdition' => ['Text'], + 'printPage' => ['Text'], + 'printSection' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dateline', - 'printColumn', - 'printEdition', - 'printPage', - 'printSection' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dateline' => ['Text'], - 'printColumn' => ['Text'], - 'printEdition' => ['Text'], - 'printPage' => ['Text'], - 'printSection' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dateline' => 'A dateline is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using locationCreated (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use contentLocation. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines".', - 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', - 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', - 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', - 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dateline' => 'A [dateline](https://en.wikipedia.org/wiki/Dateline) is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using [[locationCreated]] (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use [[contentLocation]]. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines". ', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', + 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', + 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', + 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A dateline is a brief piece of text included in news articles that - * describes where and when the story was written or filed though the date is - * often omitted. Sometimes only a placename is provided. Structured - * representations of dateline-related information can also be expressed more - * explicitly using locationCreated (which represents where a work was created - * e.g. where a news report was written). For location depicted or described - * in the content, use contentLocation. Dateline summaries are oriented more - * towards human readers than towards automated processing, and can vary - * substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", - * "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", - * "QUEZON CITY, Philippines". - * - * @var string [schema.org types: Text] - */ - public $dateline; - /** - * The number of the column in which the NewsArticle appears in the print - * edition. - * - * @var string [schema.org types: Text] - */ - public $printColumn; - /** - * The edition of the print product in which the NewsArticle appears. - * - * @var string [schema.org types: Text] - */ - public $printEdition; - /** - * If this NewsArticle appears in print, this field indicates the name of the - * page on which the article is found. Please note that this field is intended - * for the exact page name (e.g. A5, B18). - * - * @var string [schema.org types: Text] - */ - public $printPage; - /** - * If this NewsArticle appears in print, this field indicates the print - * section in which the article appeared. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $printSection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dateline', 'printColumn', 'printEdition', 'printPage', 'printSection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AskPublicNewsArticleInterface.php b/src/models/jsonld/AskPublicNewsArticleInterface.php new file mode 100644 index 000000000..3cba7da72 --- /dev/null +++ b/src/models/jsonld/AskPublicNewsArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AssessActionInterface.php b/src/models/jsonld/AssessActionInterface.php new file mode 100644 index 000000000..3935f6518 --- /dev/null +++ b/src/models/jsonld/AssessActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AssignActionInterface.php b/src/models/jsonld/AssignActionInterface.php new file mode 100644 index 000000000..f105f2ff1 --- /dev/null +++ b/src/models/jsonld/AssignActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. The number of interactions for the CreativeWork using the - * WebSite or SoftwareApplication. The most specific child type of - * InteractionCounter should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AtlasInterface.php b/src/models/jsonld/AtlasInterface.php new file mode 100644 index 000000000..f4bea5967 --- /dev/null +++ b/src/models/jsonld/AtlasInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AttorneyInterface.php b/src/models/jsonld/AttorneyInterface.php new file mode 100644 index 000000000..6b5a64f6e --- /dev/null +++ b/src/models/jsonld/AttorneyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'audienceType' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'geographicArea' => ['AdministrativeArea'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'audienceType', - 'geographicArea' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'audienceType' => ['Text'], - 'geographicArea' => ['AdministrativeArea'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'audienceType' => 'The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).', + 'description' => 'A description of the item.', + '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.', + 'geographicArea' => 'The geographic area associated with the audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'audienceType' => 'The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).', - 'geographicArea' => 'The geographic area associated with the audience.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The target group associated with a given audience (e.g. veterans, car - * owners, musicians, etc.). - * - * @var string [schema.org types: Text] - */ - public $audienceType; - /** - * The geographic area associated with the audience. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] + * @inheritdoc */ - public $geographicArea; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['audienceType', 'geographicArea'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AudienceInterface.php b/src/models/jsonld/AudienceInterface.php new file mode 100644 index 000000000..094ae3bd4 --- /dev/null +++ b/src/models/jsonld/AudienceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'caption' => ['Text', 'MediaObject'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'embeddedTextCaption' => ['Text'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'transcript' => ['Text'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'caption', - 'transcript' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'caption' => ['MediaObject', 'Text'], - 'transcript' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]].', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'embeddedTextCaption' => 'Represents textual captioning from a [[MediaObject]], e.g. text of a \'meme\'.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'transcript' => 'If this MediaObject is an AudioObject or VideoObject, the transcript of that object.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the encodingFormat.', - 'transcript' => 'If this MediaObject is an AudioObject or VideoObject, the transcript of that object.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The caption for this object. For downloadable machine formats (closed - * caption, subtitles etc.) use MediaObject and indicate the encodingFormat. - * - * @var mixed|MediaObject|string [schema.org types: MediaObject, Text] - */ - public $caption; - /** - * If this MediaObject is an AudioObject or VideoObject, the transcript of - * that object. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $transcript; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['caption', 'transcript'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AudioObjectInterface.php b/src/models/jsonld/AudioObjectInterface.php new file mode 100644 index 000000000..43abd9f30 --- /dev/null +++ b/src/models/jsonld/AudioObjectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'caption' => ['Text', 'MediaObject'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'embeddedTextCaption' => ['Text'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'transcript' => ['Text'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]].', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'embeddedTextCaption' => 'Represents textual captioning from a [[MediaObject]], e.g. text of a \'meme\'.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'transcript' => 'If this MediaObject is an AudioObject or VideoObject, the transcript of that object.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/AudioObjectSnapshotInterface.php b/src/models/jsonld/AudioObjectSnapshotInterface.php new file mode 100644 index 000000000..cb86db202 --- /dev/null +++ b/src/models/jsonld/AudioObjectSnapshotInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abridged' => ['Boolean'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'bookEdition' => ['Text'], + 'bookFormat' => ['BookFormatType'], + 'caption' => ['Text', 'MediaObject'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'embeddedTextCaption' => ['Text'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'illustrator' => ['Person'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'isbn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numberOfPages' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'readBy' => ['Person'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'transcript' => ['Text'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'duration', - 'readBy' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'duration' => ['Duration'], - 'readBy' => ['Person'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abridged' => 'Indicates whether the book is an abridged edition.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'bookEdition' => 'The edition of the book.', + 'bookFormat' => 'The format of the book.', + 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]].', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'embeddedTextCaption' => 'Represents textual captioning from a [[MediaObject]], e.g. text of a \'meme\'.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'illustrator' => 'The illustrator of the book.', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'isbn' => 'The ISBN of the book.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numberOfPages' => 'The number of pages in the book.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'readBy' => 'A person who reads (performs) the audiobook.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'transcript' => 'If this MediaObject is an AudioObject or VideoObject, the transcript of that object.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'readBy' => 'A person who reads (performs) the audiobook.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * A person who reads (performs) the audiobook. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $readBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['duration', 'readBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AudiobookFormat.php b/src/models/jsonld/AudiobookFormat.php index 9d7252b23..5920b32bc 100644 --- a/src/models/jsonld/AudiobookFormat.php +++ b/src/models/jsonld/AudiobookFormat.php @@ -1,29 +1,29 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AudiobookFormatInterface.php b/src/models/jsonld/AudiobookFormatInterface.php new file mode 100644 index 000000000..580eaee68 --- /dev/null +++ b/src/models/jsonld/AudiobookFormatInterface.php @@ -0,0 +1,24 @@ + ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] - */ - public $supersededBy; - - // Public Methods - // ========================================================================= - - /** - * @inheritdoc - */ - public function init(): void - { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); - } - - /** - * @inheritdoc - */ - public function rules(): array - { - $rules = parent::rules(); - $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] - ]); - - return $rules; - } -} diff --git a/src/models/jsonld/AuthoritativeLegalValue.php b/src/models/jsonld/AuthoritativeLegalValue.php index 8c3875b25..8284db483 100644 --- a/src/models/jsonld/AuthoritativeLegalValue.php +++ b/src/models/jsonld/AuthoritativeLegalValue.php @@ -1,31 +1,31 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AuthoritativeLegalValueInterface.php b/src/models/jsonld/AuthoritativeLegalValueInterface.php new file mode 100644 index 000000000..1de7f15be --- /dev/null +++ b/src/models/jsonld/AuthoritativeLegalValueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'recipient' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AuthorizeActionInterface.php b/src/models/jsonld/AuthorizeActionInterface.php new file mode 100644 index 000000000..7af90dd68 --- /dev/null +++ b/src/models/jsonld/AuthorizeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AutoBodyShopInterface.php b/src/models/jsonld/AutoBodyShopInterface.php new file mode 100644 index 000000000..deee0c61a --- /dev/null +++ b/src/models/jsonld/AutoBodyShopInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AutoDealerInterface.php b/src/models/jsonld/AutoDealerInterface.php new file mode 100644 index 000000000..f7c5326f6 --- /dev/null +++ b/src/models/jsonld/AutoDealerInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AutoPartsStoreInterface.php b/src/models/jsonld/AutoPartsStoreInterface.php new file mode 100644 index 000000000..1eda0f492 --- /dev/null +++ b/src/models/jsonld/AutoPartsStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AutoRentalInterface.php b/src/models/jsonld/AutoRentalInterface.php new file mode 100644 index 000000000..735a38ce4 --- /dev/null +++ b/src/models/jsonld/AutoRentalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AutoRepairInterface.php b/src/models/jsonld/AutoRepairInterface.php new file mode 100644 index 000000000..a766de47c --- /dev/null +++ b/src/models/jsonld/AutoRepairInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AutoWashInterface.php b/src/models/jsonld/AutoWashInterface.php new file mode 100644 index 000000000..f0b0b17ea --- /dev/null +++ b/src/models/jsonld/AutoWashInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'feesAndCommissionsSpecification' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'feesAndCommissionsSpecification' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Description of fees, commissions, and other terms applied either to a class - * of financial product, or by a financial service organization. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $feesAndCommissionsSpecification; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['feesAndCommissionsSpecification'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AutomatedTellerInterface.php b/src/models/jsonld/AutomatedTellerInterface.php new file mode 100644 index 000000000..2b940d843 --- /dev/null +++ b/src/models/jsonld/AutomatedTellerInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AutomotiveBusinessInterface.php b/src/models/jsonld/AutomotiveBusinessInterface.php new file mode 100644 index 000000000..eb53d5fed --- /dev/null +++ b/src/models/jsonld/AutomotiveBusinessInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/AyurvedicInterface.php b/src/models/jsonld/AyurvedicInterface.php new file mode 100644 index 000000000..52e717509 --- /dev/null +++ b/src/models/jsonld/AyurvedicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BackOrderInterface.php b/src/models/jsonld/BackOrderInterface.php new file mode 100644 index 000000000..873f4f9fa --- /dev/null +++ b/src/models/jsonld/BackOrderInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dateline' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'printColumn' => ['Text'], + 'printEdition' => ['Text'], + 'printPage' => ['Text'], + 'printSection' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dateline', - 'printColumn', - 'printEdition', - 'printPage', - 'printSection' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dateline' => ['Text'], - 'printColumn' => ['Text'], - 'printEdition' => ['Text'], - 'printPage' => ['Text'], - 'printSection' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dateline' => 'A dateline is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using locationCreated (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use contentLocation. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines".', - 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', - 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', - 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', - 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dateline' => 'A [dateline](https://en.wikipedia.org/wiki/Dateline) is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using [[locationCreated]] (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use [[contentLocation]]. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines". ', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', + 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', + 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', + 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A dateline is a brief piece of text included in news articles that - * describes where and when the story was written or filed though the date is - * often omitted. Sometimes only a placename is provided. Structured - * representations of dateline-related information can also be expressed more - * explicitly using locationCreated (which represents where a work was created - * e.g. where a news report was written). For location depicted or described - * in the content, use contentLocation. Dateline summaries are oriented more - * towards human readers than towards automated processing, and can vary - * substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", - * "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", - * "QUEZON CITY, Philippines". - * - * @var string [schema.org types: Text] - */ - public $dateline; - /** - * The number of the column in which the NewsArticle appears in the print - * edition. - * - * @var string [schema.org types: Text] - */ - public $printColumn; - /** - * The edition of the print product in which the NewsArticle appears. - * - * @var string [schema.org types: Text] - */ - public $printEdition; - /** - * If this NewsArticle appears in print, this field indicates the name of the - * page on which the article is found. Please note that this field is intended - * for the exact page name (e.g. A5, B18). - * - * @var string [schema.org types: Text] - */ - public $printPage; - /** - * If this NewsArticle appears in print, this field indicates the print - * section in which the article appeared. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $printSection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dateline', 'printColumn', 'printEdition', 'printPage', 'printSection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BackgroundNewsArticleInterface.php b/src/models/jsonld/BackgroundNewsArticleInterface.php new file mode 100644 index 000000000..86b26a2bd --- /dev/null +++ b/src/models/jsonld/BackgroundNewsArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BacteriaInterface.php b/src/models/jsonld/BacteriaInterface.php new file mode 100644 index 000000000..7b376f2c8 --- /dev/null +++ b/src/models/jsonld/BacteriaInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BakeryInterface.php b/src/models/jsonld/BakeryInterface.php new file mode 100644 index 000000000..6765a1602 --- /dev/null +++ b/src/models/jsonld/BakeryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BalanceInterface.php b/src/models/jsonld/BalanceInterface.php new file mode 100644 index 000000000..f0d0026cb --- /dev/null +++ b/src/models/jsonld/BalanceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accountMinimumInflow' => ['MonetaryAmount'], + 'accountOverdraftLimit' => ['MonetaryAmount'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'bankAccountType' => ['Text', 'URL'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accountMinimumInflow', - 'accountOverdraftLimit', - 'bankAccountType' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accountMinimumInflow' => ['MonetaryAmount'], - 'accountOverdraftLimit' => ['MonetaryAmount'], - 'bankAccountType' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'accountMinimumInflow' => 'A minimum amount that has to be paid in every month.', - 'accountOverdraftLimit' => 'An overdraft is an extension of credit from a lending institution when an account reaches zero. An overdraft allows the individual to continue withdrawing money even if the account has no funds in it. Basically the bank allows people to borrow a set amount of money.', - 'bankAccountType' => 'The type of a bank account.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accountMinimumInflow' => 'A minimum amount that has to be paid in every month.', + 'accountOverdraftLimit' => 'An overdraft is an extension of credit from a lending institution when an account reaches zero. An overdraft allows the individual to continue withdrawing money even if the account has no funds in it. Basically the bank allows people to borrow a set amount of money.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'bankAccountType' => 'The type of a bank account.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A minimum amount that has to be paid in every month. - * - * @var MonetaryAmount [schema.org types: MonetaryAmount] - */ - public $accountMinimumInflow; - /** - * An overdraft is an extension of credit from a lending institution when an - * account reaches zero. An overdraft allows the individual to continue - * withdrawing money even if the account has no funds in it. Basically the - * bank allows people to borrow a set amount of money. - * - * @var MonetaryAmount [schema.org types: MonetaryAmount] - */ - public $accountOverdraftLimit; /** - * The type of a bank account. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $bankAccountType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accountMinimumInflow', 'accountOverdraftLimit', 'bankAccountType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BankAccountInterface.php b/src/models/jsonld/BankAccountInterface.php new file mode 100644 index 000000000..35e121b60 --- /dev/null +++ b/src/models/jsonld/BankAccountInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'feesAndCommissionsSpecification' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'feesAndCommissionsSpecification' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Description of fees, commissions, and other terms applied either to a class - * of financial product, or by a financial service organization. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $feesAndCommissionsSpecification; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['feesAndCommissionsSpecification'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BankOrCreditUnionInterface.php b/src/models/jsonld/BankOrCreditUnionInterface.php new file mode 100644 index 000000000..c6b29c686 --- /dev/null +++ b/src/models/jsonld/BankOrCreditUnionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BarOrPubInterface.php b/src/models/jsonld/BarOrPubInterface.php new file mode 100644 index 000000000..6064a3c9f --- /dev/null +++ b/src/models/jsonld/BarOrPubInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'caption' => ['Text', 'MediaObject'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'embeddedTextCaption' => ['Text'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'exifData' => ['PropertyValue', 'Text'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'representativeOfPage' => ['Boolean'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnail' => ['ImageObject'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'caption', - 'exifData', - 'representativeOfPage', - 'thumbnail' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'caption' => ['MediaObject', 'Text'], - 'exifData' => ['PropertyValue', 'Text'], - 'representativeOfPage' => ['Boolean'], - 'thumbnail' => ['ImageObject'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the encodingFormat.', - 'exifData' => 'exif data for this object.', - 'representativeOfPage' => 'Indicates whether this image is representative of the content of the page.', - 'thumbnail' => 'Thumbnail image for an image or video.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]].', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'embeddedTextCaption' => 'Represents textual captioning from a [[MediaObject]], e.g. text of a \'meme\'.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'exifData' => 'exif data for this object.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'representativeOfPage' => 'Indicates whether this image is representative of the content of the page.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnail' => 'Thumbnail image for an image or video.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The caption for this object. For downloadable machine formats (closed - * caption, subtitles etc.) use MediaObject and indicate the encodingFormat. - * - * @var mixed|MediaObject|string [schema.org types: MediaObject, Text] - */ - public $caption; - /** - * exif data for this object. - * - * @var mixed|PropertyValue|string [schema.org types: PropertyValue, Text] - */ - public $exifData; - /** - * Indicates whether this image is representative of the content of the page. - * - * @var bool [schema.org types: Boolean] - */ - public $representativeOfPage; /** - * Thumbnail image for an image or video. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $thumbnail; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['caption', 'exifData', 'representativeOfPage', 'thumbnail'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BarcodeInterface.php b/src/models/jsonld/BarcodeInterface.php new file mode 100644 index 000000000..4a25f4f45 --- /dev/null +++ b/src/models/jsonld/BarcodeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BasicIncomeInterface.php b/src/models/jsonld/BasicIncomeInterface.php new file mode 100644 index 000000000..0a9ad269d --- /dev/null +++ b/src/models/jsonld/BasicIncomeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BeachInterface.php b/src/models/jsonld/BeachInterface.php new file mode 100644 index 000000000..29717f96f --- /dev/null +++ b/src/models/jsonld/BeachInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BeautySalonInterface.php b/src/models/jsonld/BeautySalonInterface.php new file mode 100644 index 000000000..d590ab23a --- /dev/null +++ b/src/models/jsonld/BeautySalonInterface.php @@ -0,0 +1,24 @@ +dedicated + * document on the use of schema.org for marking up hotels and other forms of + * accommodations. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/BedAndBreakfast + * @see https://schema.org/BedAndBreakfast */ -class BedAndBreakfast extends LodgingBusiness +class BedAndBreakfast extends MetaJsonLd implements BedAndBreakfastInterface, LodgingBusinessInterface, LocalBusinessInterface, OrganizationInterface, ThingInterface, PlaceInterface { // Static Public Properties // ========================================================================= @@ -32,235 +33,339 @@ class BedAndBreakfast extends LodgingBusiness * * @var string */ - static public $schemaTypeName = 'BedAndBreakfast'; + static public string $schemaTypeName = 'BedAndBreakfast'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/BedAndBreakfast'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'Bed and breakfast. See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/BedAndBreakfast'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'LodgingBusiness'; + static public string $schemaTypeExtends = 'LodgingBusiness'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<
+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use BedAndBreakfastTrait; + use LodgingBusinessTrait; + use LocalBusinessTrait; + use OrganizationTrait; + use ThingTrait; + use PlaceTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableLanguage' => ['Text', 'Language'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'checkinTime' => ['DateTime', 'Time'], + 'checkoutTime' => ['DateTime', 'Time'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amenityFeature', - 'audience', - 'availableLanguage', - 'checkinTime', - 'checkoutTime', - 'numberOfRooms', - 'petsAllowed', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amenityFeature' => ['LocationFeatureSpecification'], - 'audience' => ['Audience'], - 'availableLanguage' => ['Language', 'Text'], - 'checkinTime' => ['DateTime', 'Time'], - 'checkoutTime' => ['DateTime', 'Time'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'petsAllowed' => ['Boolean', 'Text'], - 'starRating' => ['Rating'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. See also inLanguage', - 'checkinTime' => 'The earliest someone may check into a lodging establishment.', - 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A language someone may use with or at the item, service or place. Please - * use one of the language codes from the IETF BCP 47 standard. See also - * inLanguage - * - * @var mixed|Language|string [schema.org types: Language, Text] + * @inheritdoc */ - public $availableLanguage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'checkinTime' => 'The earliest someone may check into a lodging establishment.', + 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The earliest someone may check into a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkinTime; - /** - * The latest someone may check out of a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkoutTime; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; - /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amenityFeature', 'audience', 'availableLanguage', 'checkinTime', 'checkoutTime', 'numberOfRooms', 'petsAllowed', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BedAndBreakfastInterface.php b/src/models/jsonld/BedAndBreakfastInterface.php new file mode 100644 index 000000000..e6f1946ff --- /dev/null +++ b/src/models/jsonld/BedAndBreakfastInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'numberOfBeds' => ['Number'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'typeOfBed' => ['BedType', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'numberOfBeds', - 'typeOfBed' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'numberOfBeds' => ['Number'], - 'typeOfBed' => ['BedType', 'Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'numberOfBeds' => 'The quantity of the given bed type available in the HotelRoom, Suite, House, or Apartment.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'typeOfBed' => 'The type of bed to which the BedDetail refers, i.e. the type of bed available in the quantity indicated by quantity.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'numberOfBeds' => 'The quantity of the given bed type available in the HotelRoom, Suite, House, or Apartment.', - 'typeOfBed' => 'The type of bed to which the BedDetail refers, i.e. the type of bed available in the quantity indicated by quantity.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The quantity of the given bed type available in the HotelRoom, Suite, - * House, or Apartment. - * - * @var float [schema.org types: Number] - */ - public $numberOfBeds; - /** - * The type of bed to which the BedDetail refers, i.e. the type of bed - * available in the quantity indicated by quantity. - * - * @var mixed|BedType|string [schema.org types: BedType, Text] + * @inheritdoc */ - public $typeOfBed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['numberOfBeds', 'typeOfBed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BedDetailsInterface.php b/src/models/jsonld/BedDetailsInterface.php new file mode 100644 index 000000000..42a49bd56 --- /dev/null +++ b/src/models/jsonld/BedDetailsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'equal', - 'greater', - 'greaterOrEqual', - 'lesser', - 'lesserOrEqual', - 'nonEqual', - 'valueReference' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'equal' => ['QualitativeValue'], - 'greater' => ['QualitativeValue'], - 'greaterOrEqual' => ['QualitativeValue'], - 'lesser' => ['QualitativeValue'], - 'lesserOrEqual' => ['QualitativeValue'], - 'nonEqual' => ['QualitativeValue'], - 'valueReference' => ['Enumeration', 'PropertyValue', 'QualitativeValue', 'QuantitativeValue', 'StructuredValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', - 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', - 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', - 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', - 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', - 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', - 'valueReference' => 'A pointer to a secondary value that provides additional information on the original value, e.g. a reference temperature.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * This ordering relation for qualitative values indicates that the subject is - * equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $equal; - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] + * @inheritdoc */ - public $greater; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $greaterOrEqual; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesser; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesserOrEqual; /** - * This ordering relation for qualitative values indicates that the subject is - * not equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $nonEqual; - /** - * A pointer to a secondary value that provides additional information on the - * original value, e.g. a reference temperature. - * - * @var mixed|Enumeration|PropertyValue|QualitativeValue|QuantitativeValue|StructuredValue [schema.org types: Enumeration, PropertyValue, QualitativeValue, QuantitativeValue, StructuredValue] + * @inheritdoc */ - public $valueReference; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'equal', 'greater', 'greaterOrEqual', 'lesser', 'lesserOrEqual', 'nonEqual', 'valueReference'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BedTypeInterface.php b/src/models/jsonld/BedTypeInterface.php new file mode 100644 index 000000000..9be97f2b7 --- /dev/null +++ b/src/models/jsonld/BedTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BefriendActionInterface.php b/src/models/jsonld/BefriendActionInterface.php new file mode 100644 index 000000000..cefdcff50 --- /dev/null +++ b/src/models/jsonld/BefriendActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BenefitsHealthAspectInterface.php b/src/models/jsonld/BenefitsHealthAspectInterface.php new file mode 100644 index 000000000..1c0a7a7bb --- /dev/null +++ b/src/models/jsonld/BenefitsHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BikeStoreInterface.php b/src/models/jsonld/BikeStoreInterface.php new file mode 100644 index 000000000..32d2e3654 --- /dev/null +++ b/src/models/jsonld/BikeStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedDisease' => ['URL', 'PropertyValue', 'MedicalCondition'], + 'bioChemInteraction' => ['BioChemEntity'], + 'bioChemSimilarity' => ['BioChemEntity'], + 'biologicalRole' => ['DefinedTerm'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'hasBioChemEntityPart' => ['BioChemEntity'], + 'hasMolecularFunction' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'hasRepresentation' => ['Text', 'PropertyValue', 'URL'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isEncodedByBioChemEntity' => ['Gene'], + 'isInvolvedInBiologicalProcess' => ['PropertyValue', 'URL', 'DefinedTerm'], + 'isLocatedInSubcellularLocation' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'isPartOfBioChemEntity' => ['BioChemEntity'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxonomicRange' => ['URL', 'DefinedTerm', 'Text', 'Taxon'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + '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.', + 'bioChemInteraction' => 'A BioChemEntity that is known to interact with this item.', + 'bioChemSimilarity' => 'A similar BioChemEntity, e.g., obtained by fingerprint similarity algorithms.', + 'biologicalRole' => 'A role played by the BioChemEntity within a biological context.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'hasBioChemEntityPart' => 'Indicates a BioChemEntity that (in some sense) has this BioChemEntity as a part. ', + 'hasMolecularFunction' => 'Molecular function performed by this BioChemEntity; please use PropertyValue if you want to include any evidence.', + 'hasRepresentation' => 'A common representation such as a protein sequence or chemical structure for this entity. For images use schema.org/image.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isEncodedByBioChemEntity' => 'Another BioChemEntity encoding by this one.', + 'isInvolvedInBiologicalProcess' => 'Biological process this BioChemEntity is involved in; please use PropertyValue if you want to include any evidence.', + 'isLocatedInSubcellularLocation' => 'Subcellular location where this BioChemEntity is located; please use PropertyValue if you want to include any evidence.', + 'isPartOfBioChemEntity' => 'Indicates a BioChemEntity that is (in some sense) a part of this BioChemEntity. ', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxonomicRange' => 'The taxonomic grouping of the organism that expresses, encodes, or in someway related to the BioChemEntity.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BioChemEntityInterface.php b/src/models/jsonld/BioChemEntityInterface.php new file mode 100644 index 000000000..5b6b294db --- /dev/null +++ b/src/models/jsonld/BioChemEntityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'blogPost' => ['BlogPosting'], + 'blogPosts' => ['BlogPosting'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'blogPost', - 'issn' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'blogPost' => ['BlogPosting'], - 'issn' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'blogPost' => 'A posting that is part of this blog.', + 'blogPosts' => 'Indicates a post that is part of a [[Blog]]. Note that historically, what we term a "Blog" was once known as a "weblog", and that what we term a "BlogPosting" is now often colloquially referred to as a "blog".', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'blogPost' => 'A posting that is part of this blog. Supersedes blogPosts.', - 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A posting that is part of this blog. Supersedes blogPosts. - * - * @var BlogPosting [schema.org types: BlogPosting] - */ - public $blogPost; - /** - * The International Standard Serial Number (ISSN) that identifies this serial - * publication. You can repeat this property to identify different formats of, - * or the linking ISSN (ISSN-L) for, this serial publication. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $issn; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['blogPost', 'issn'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BlogInterface.php b/src/models/jsonld/BlogInterface.php new file mode 100644 index 000000000..812bf2190 --- /dev/null +++ b/src/models/jsonld/BlogInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sharedContent' => ['CreativeWork'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'sharedContent' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sharedContent' => 'A CreativeWork such as an image, video, or audio clip shared as part of this posting.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'sharedContent' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'sharedContent' => 'A CreativeWork such as an image, video, or audio clip shared as part of this posting.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - 'author', - 'datePublished', - 'headline', - 'image', - 'publisher' - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - 'dateModified', - 'mainEntityOfPage' - ]; - /** - * A CreativeWork such as an image, video, or audio clip shared as part of - * this posting. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $sharedContent; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['sharedContent'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BlogPostingInterface.php b/src/models/jsonld/BlogPostingInterface.php new file mode 100644 index 000000000..d1cdf8b4f --- /dev/null +++ b/src/models/jsonld/BlogPostingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'affectedBy' => ['Drug'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'normalRange' => ['Text', 'MedicalEnumeration'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'signDetected' => ['MedicalSign'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'usedToDiagnose' => ['MedicalCondition'], + 'usesDevice' => ['MedicalDevice'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'affectedBy', - 'normalRange', - 'signDetected', - 'usedToDiagnose', - 'usesDevice' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'affectedBy' => ['Drug'], - 'normalRange' => ['MedicalEnumeration', 'Text'], - 'signDetected' => ['MedicalSign'], - 'usedToDiagnose' => ['MedicalCondition'], - 'usesDevice' => ['MedicalDevice'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'affectedBy' => 'Drugs that affect the test\'s results.', - 'normalRange' => 'Range of acceptable values for a typical patient, when applicable.', - 'signDetected' => 'A sign detected by the test.', - 'usedToDiagnose' => 'A condition the test is used to diagnose.', - 'usesDevice' => 'Device used to perform the test.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'affectedBy' => 'Drugs that affect the test\'s results.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'normalRange' => 'Range of acceptable values for a typical patient, when applicable.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'signDetected' => 'A sign detected by the test.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'usedToDiagnose' => 'A condition the test is used to diagnose.', + 'usesDevice' => 'Device used to perform the test.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * Drugs that affect the test's results. - * - * @var Drug [schema.org types: Drug] - */ - public $affectedBy; - /** - * Range of acceptable values for a typical patient, when applicable. - * - * @var mixed|MedicalEnumeration|string [schema.org types: MedicalEnumeration, Text] - */ - public $normalRange; - /** - * A sign detected by the test. - * - * @var MedicalSign [schema.org types: MedicalSign] - */ - public $signDetected; - /** - * A condition the test is used to diagnose. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $usedToDiagnose; - /** - * Device used to perform the test. - * - * @var MedicalDevice [schema.org types: MedicalDevice] + * @inheritdoc */ - public $usesDevice; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['affectedBy', 'normalRange', 'signDetected', 'usedToDiagnose', 'usesDevice'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BloodTestInterface.php b/src/models/jsonld/BloodTestInterface.php new file mode 100644 index 000000000..c9629e375 --- /dev/null +++ b/src/models/jsonld/BloodTestInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BoardingPolicyTypeInterface.php b/src/models/jsonld/BoardingPolicyTypeInterface.php new file mode 100644 index 000000000..d323c73b8 --- /dev/null +++ b/src/models/jsonld/BoardingPolicyTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BoatReservationInterface.php b/src/models/jsonld/BoatReservationInterface.php new file mode 100644 index 000000000..8a8a8b5f2 --- /dev/null +++ b/src/models/jsonld/BoatReservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BoatTerminalInterface.php b/src/models/jsonld/BoatTerminalInterface.php new file mode 100644 index 000000000..64907ecd2 --- /dev/null +++ b/src/models/jsonld/BoatTerminalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'arrivalBoatTerminal' => ['BoatTerminal'], + 'arrivalTime' => ['Time', 'DateTime'], + 'departureBoatTerminal' => ['BoatTerminal'], + 'departureTime' => ['Time', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itinerary' => ['ItemList', 'Place'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfTrip' => ['Trip'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'sameAs' => ['URL'], + 'subTrip' => ['Trip'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'arrivalBoatTerminal' => 'The terminal or port from which the boat arrives.', + 'arrivalTime' => 'The expected arrival time.', + 'departureBoatTerminal' => 'The terminal or port from which the boat departs.', + 'departureTime' => 'The expected departure time.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itinerary' => 'Destination(s) ( [[Place]] ) that make up a trip. For a trip where destination order is important use [[ItemList]] to specify that order (see examples).', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'partOfTrip' => 'Identifies that this [[Trip]] is a subTrip of another Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + '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.', + 'subTrip' => 'Identifies a [[Trip]] that is a subTrip of this Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BoatTripInterface.php b/src/models/jsonld/BoatTripInterface.php new file mode 100644 index 000000000..d22ff0826 --- /dev/null +++ b/src/models/jsonld/BoatTripInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementArmInterface.php b/src/models/jsonld/BodyMeasurementArmInterface.php new file mode 100644 index 000000000..647ad3a8c --- /dev/null +++ b/src/models/jsonld/BodyMeasurementArmInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementBustInterface.php b/src/models/jsonld/BodyMeasurementBustInterface.php new file mode 100644 index 000000000..3119f9682 --- /dev/null +++ b/src/models/jsonld/BodyMeasurementBustInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementChestInterface.php b/src/models/jsonld/BodyMeasurementChestInterface.php new file mode 100644 index 000000000..4ea51642c --- /dev/null +++ b/src/models/jsonld/BodyMeasurementChestInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementFootInterface.php b/src/models/jsonld/BodyMeasurementFootInterface.php new file mode 100644 index 000000000..eb021b617 --- /dev/null +++ b/src/models/jsonld/BodyMeasurementFootInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementHandInterface.php b/src/models/jsonld/BodyMeasurementHandInterface.php new file mode 100644 index 000000000..3ba3db08a --- /dev/null +++ b/src/models/jsonld/BodyMeasurementHandInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementHeadInterface.php b/src/models/jsonld/BodyMeasurementHeadInterface.php new file mode 100644 index 000000000..d87d008e9 --- /dev/null +++ b/src/models/jsonld/BodyMeasurementHeadInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementHeightInterface.php b/src/models/jsonld/BodyMeasurementHeightInterface.php new file mode 100644 index 000000000..7ba133184 --- /dev/null +++ b/src/models/jsonld/BodyMeasurementHeightInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementHipsInterface.php b/src/models/jsonld/BodyMeasurementHipsInterface.php new file mode 100644 index 000000000..ebf6a4e3d --- /dev/null +++ b/src/models/jsonld/BodyMeasurementHipsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementInsideLegInterface.php b/src/models/jsonld/BodyMeasurementInsideLegInterface.php new file mode 100644 index 000000000..f119f76a0 --- /dev/null +++ b/src/models/jsonld/BodyMeasurementInsideLegInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementNeckInterface.php b/src/models/jsonld/BodyMeasurementNeckInterface.php new file mode 100644 index 000000000..45696be54 --- /dev/null +++ b/src/models/jsonld/BodyMeasurementNeckInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementTypeEnumerationInterface.php b/src/models/jsonld/BodyMeasurementTypeEnumerationInterface.php new file mode 100644 index 000000000..b898eccf6 --- /dev/null +++ b/src/models/jsonld/BodyMeasurementTypeEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementUnderbustInterface.php b/src/models/jsonld/BodyMeasurementUnderbustInterface.php new file mode 100644 index 000000000..43a93dba9 --- /dev/null +++ b/src/models/jsonld/BodyMeasurementUnderbustInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementWaistInterface.php b/src/models/jsonld/BodyMeasurementWaistInterface.php new file mode 100644 index 000000000..19d5a97e9 --- /dev/null +++ b/src/models/jsonld/BodyMeasurementWaistInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BodyMeasurementWeightInterface.php b/src/models/jsonld/BodyMeasurementWeightInterface.php new file mode 100644 index 000000000..fef07deae --- /dev/null +++ b/src/models/jsonld/BodyMeasurementWeightInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place. The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number. The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. The International Standard of Industrial Classification - * of All Economic Activities (ISIC), Revision 4 code for a particular - * organization, business person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BodyOfWaterInterface.php b/src/models/jsonld/BodyOfWaterInterface.php new file mode 100644 index 000000000..7739ad391 --- /dev/null +++ b/src/models/jsonld/BodyOfWaterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedPathophysiology', - 'bodyLocation', - 'connectedTo', - 'diagram', - 'partOfSystem', - 'relatedCondition', - 'relatedTherapy', - 'subStructure' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedPathophysiology' => ['Text'], - 'bodyLocation' => ['Text'], - 'connectedTo' => ['AnatomicalStructure'], - 'diagram' => ['ImageObject'], - 'partOfSystem' => ['AnatomicalSystem'], - 'relatedCondition' => ['MedicalCondition'], - 'relatedTherapy' => ['MedicalTherapy'], - 'subStructure' => ['AnatomicalStructure'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', - 'bodyLocation' => 'Location in the body of the anatomical structure.', - 'connectedTo' => 'Other anatomical structures to which this structure is connected.', - 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', - 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', - 'relatedCondition' => 'A medical condition associated with this anatomy.', - 'relatedTherapy' => 'A medical therapy related to this anatomy.', - 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * If applicable, a description of the pathophysiology associated with the - * anatomical system, including potential abnormal changes in the mechanical, - * physical, and biochemical functions of the system. - * - * @var string [schema.org types: Text] - */ - public $associatedPathophysiology; - /** - * Location in the body of the anatomical structure. - * - * @var string [schema.org types: Text] - */ - public $bodyLocation; - /** - * Other anatomical structures to which this structure is connected. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $connectedTo; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * An image containing a diagram that illustrates the structure and/or its - * component substructures and/or connections with other structures. - * - * @var ImageObject [schema.org types: ImageObject] - */ - public $diagram; - /** - * The anatomical or organ system that this structure is part of. - * - * @var AnatomicalSystem [schema.org types: AnatomicalSystem] - */ - public $partOfSystem; - /** - * A medical condition associated with this anatomy. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $relatedCondition; /** - * A medical therapy related to this anatomy. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $relatedTherapy; - /** - * Component (sub-)structure(s) that comprise this anatomical structure. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $subStructure; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedPathophysiology', 'bodyLocation', 'connectedTo', 'diagram', 'partOfSystem', 'relatedCondition', 'relatedTherapy', 'subStructure'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BoneInterface.php b/src/models/jsonld/BoneInterface.php new file mode 100644 index 000000000..abeecac50 --- /dev/null +++ b/src/models/jsonld/BoneInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abridged' => ['Boolean'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bookEdition' => ['Text'], + 'bookFormat' => ['BookFormatType'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'illustrator' => ['Person'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'isbn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numberOfPages' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'abridged', - 'bookEdition', - 'bookFormat', - 'illustrator', - 'isbn', - 'numberOfPages' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'abridged' => ['Boolean'], - 'bookEdition' => ['Text'], - 'bookFormat' => ['BookFormatType'], - 'illustrator' => ['Person'], - 'isbn' => ['Text'], - 'numberOfPages' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'abridged' => 'Indicates whether the book is an abridged edition.', - 'bookEdition' => 'The edition of the book.', - 'bookFormat' => 'The format of the book.', - 'illustrator' => 'The illustrator of the book.', - 'isbn' => 'The ISBN of the book.', - 'numberOfPages' => 'The number of pages in the book.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * Indicates whether the book is an abridged edition. - * - * @var bool [schema.org types: Boolean] + * @inheritdoc */ - public $abridged; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abridged' => 'Indicates whether the book is an abridged edition.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bookEdition' => 'The edition of the book.', + 'bookFormat' => 'The format of the book.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'illustrator' => 'The illustrator of the book.', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'isbn' => 'The ISBN of the book.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numberOfPages' => 'The number of pages in the book.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The edition of the book. - * - * @var string [schema.org types: Text] - */ - public $bookEdition; /** - * The format of the book. - * - * @var BookFormatType [schema.org types: BookFormatType] - */ - public $bookFormat; - /** - * The illustrator of the book. - * - * @var Person [schema.org types: Person] - */ - public $illustrator; - /** - * The ISBN of the book. - * - * @var string [schema.org types: Text] - */ - public $isbn; - /** - * The number of pages in the book. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $numberOfPages; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['abridged', 'bookEdition', 'bookFormat', 'illustrator', 'isbn', 'numberOfPages'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BookFormatType.php b/src/models/jsonld/BookFormatType.php index db77ee6d4..24ef03d27 100644 --- a/src/models/jsonld/BookFormatType.php +++ b/src/models/jsonld/BookFormatType.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BookFormatTypeInterface.php b/src/models/jsonld/BookFormatTypeInterface.php new file mode 100644 index 000000000..9be9faea9 --- /dev/null +++ b/src/models/jsonld/BookFormatTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'endDate', - 'issn', - 'startDate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'endDate' => ['Date', 'DateTime'], - 'issn' => ['Text'], - 'startDate' => ['Date', 'DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The International Standard Serial Number (ISSN) that identifies this serial - * publication. You can repeat this property to identify different formats of, - * or the linking ISSN (ISSN-L) for, this serial publication. - * - * @var string [schema.org types: Text] - */ - public $issn; /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $startDate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['endDate', 'issn', 'startDate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BookSeriesInterface.php b/src/models/jsonld/BookSeriesInterface.php new file mode 100644 index 000000000..b39c866dc --- /dev/null +++ b/src/models/jsonld/BookSeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BookStoreInterface.php b/src/models/jsonld/BookStoreInterface.php new file mode 100644 index 000000000..3b7a3621a --- /dev/null +++ b/src/models/jsonld/BookStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BookmarkActionInterface.php b/src/models/jsonld/BookmarkActionInterface.php new file mode 100644 index 000000000..5fe5281d8 --- /dev/null +++ b/src/models/jsonld/BookmarkActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BooleanInterface.php b/src/models/jsonld/BooleanInterface.php new file mode 100644 index 000000000..3cd68ad58 --- /dev/null +++ b/src/models/jsonld/BooleanInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'lender' => ['Person', 'Organization'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'lender' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'lender' => 'A sub property of participant. The person that lends the object being borrowed.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'lender' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'lender' => 'A sub property of participant. The person that lends the object being borrowed.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The person that lends the object being - * borrowed. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $lender; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['lender'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BorrowActionInterface.php b/src/models/jsonld/BorrowActionInterface.php new file mode 100644 index 000000000..f28dfd95c --- /dev/null +++ b/src/models/jsonld/BorrowActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BowlingAlleyInterface.php b/src/models/jsonld/BowlingAlleyInterface.php new file mode 100644 index 000000000..ab0c8ba6e --- /dev/null +++ b/src/models/jsonld/BowlingAlleyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedPathophysiology', - 'bodyLocation', - 'connectedTo', - 'diagram', - 'partOfSystem', - 'relatedCondition', - 'relatedTherapy', - 'subStructure' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedPathophysiology' => ['Text'], - 'bodyLocation' => ['Text'], - 'connectedTo' => ['AnatomicalStructure'], - 'diagram' => ['ImageObject'], - 'partOfSystem' => ['AnatomicalSystem'], - 'relatedCondition' => ['MedicalCondition'], - 'relatedTherapy' => ['MedicalTherapy'], - 'subStructure' => ['AnatomicalStructure'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', - 'bodyLocation' => 'Location in the body of the anatomical structure.', - 'connectedTo' => 'Other anatomical structures to which this structure is connected.', - 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', - 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', - 'relatedCondition' => 'A medical condition associated with this anatomy.', - 'relatedTherapy' => 'A medical therapy related to this anatomy.', - 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * If applicable, a description of the pathophysiology associated with the - * anatomical system, including potential abnormal changes in the mechanical, - * physical, and biochemical functions of the system. - * - * @var string [schema.org types: Text] - */ - public $associatedPathophysiology; - /** - * Location in the body of the anatomical structure. - * - * @var string [schema.org types: Text] - */ - public $bodyLocation; - /** - * Other anatomical structures to which this structure is connected. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $connectedTo; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * An image containing a diagram that illustrates the structure and/or its - * component substructures and/or connections with other structures. - * - * @var ImageObject [schema.org types: ImageObject] - */ - public $diagram; - /** - * The anatomical or organ system that this structure is part of. - * - * @var AnatomicalSystem [schema.org types: AnatomicalSystem] - */ - public $partOfSystem; - /** - * A medical condition associated with this anatomy. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $relatedCondition; /** - * A medical therapy related to this anatomy. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $relatedTherapy; - /** - * Component (sub-)structure(s) that comprise this anatomical structure. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $subStructure; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedPathophysiology', 'bodyLocation', 'connectedTo', 'diagram', 'partOfSystem', 'relatedCondition', 'relatedTherapy', 'subStructure'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BrainStructureInterface.php b/src/models/jsonld/BrainStructureInterface.php new file mode 100644 index 000000000..3d1376f83 --- /dev/null +++ b/src/models/jsonld/BrainStructureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'aggregateRating', - 'logo', - 'review', - 'slogan' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'aggregateRating' => ['AggregateRating'], - 'logo' => ['ImageObject', 'URL'], - 'review' => ['Review'], - 'slogan' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'logo' => 'An associated logo.', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'review' => 'A review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $slogan; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['aggregateRating', 'logo', 'review', 'slogan'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BrandInterface.php b/src/models/jsonld/BrandInterface.php new file mode 100644 index 000000000..3f9b01d2a --- /dev/null +++ b/src/models/jsonld/BrandInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itemListElement' => ['Thing', 'ListItem', 'Text'], + 'itemListOrder' => ['Text', 'ItemListOrderType'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'numberOfItems' => ['Integer'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemListElement', - 'itemListOrder', - 'numberOfItems' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemListElement' => ['ListItem', 'Text', 'Thing'], - 'itemListOrder' => ['ItemListOrderType', 'Text'], - 'numberOfItems' => ['Integer'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'itemListElement' => 'For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem. Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists. Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a \'position\' property in such cases.', - 'itemListOrder' => 'Type of ordering (e.g. Ascending, Descending, Unordered).', - 'numberOfItems' => 'The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itemListElement' => 'For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem. Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists. Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a \'position\' property in such cases.', + 'itemListOrder' => 'Type of ordering (e.g. Ascending, Descending, Unordered).', + '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.', + 'name' => 'The name of the item.', + 'numberOfItems' => 'The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For itemListElement values, you can use simple strings (e.g. "Peter", - * "Paul", "Mary"), existing entities, or use ListItem. Text values are best - * if the elements in the list are plain strings. Existing entities are best - * for a simple, unordered list of existing things in your data. ListItem is - * used with ordered lists when you want to provide additional context about - * the element in that list or when the same item might be in different places - * in different lists. Note: The order of elements in your mark-up is not - * sufficient for indicating the order or elements. Use ListItem with a - * 'position' property in such cases. - * - * @var mixed|array|ListItem|string|Thing [schema.org types: ListItem, Text, Thing] - */ - public $itemListElement; - /** - * Type of ordering (e.g. Ascending, Descending, Unordered). - * - * @var mixed|ItemListOrderType|string [schema.org types: ItemListOrderType, Text] - */ - public $itemListOrder; - /** - * The number of items in an ItemList. Note that some descriptions might not - * fully describe all items in a list (e.g., multi-page pagination); in such - * cases, the numberOfItems would be for the entire list. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $numberOfItems; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemListElement', 'itemListOrder', 'numberOfItems'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BreadcrumbListInterface.php b/src/models/jsonld/BreadcrumbListInterface.php new file mode 100644 index 000000000..f934bdb45 --- /dev/null +++ b/src/models/jsonld/BreadcrumbListInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BreweryInterface.php b/src/models/jsonld/BreweryInterface.php new file mode 100644 index 000000000..18f75a709 --- /dev/null +++ b/src/models/jsonld/BreweryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BridgeInterface.php b/src/models/jsonld/BridgeInterface.php new file mode 100644 index 000000000..1675da07f --- /dev/null +++ b/src/models/jsonld/BridgeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'broadcastChannelId' => ['Text'], + 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], + 'broadcastServiceTier' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'genre' => ['URL', 'Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inBroadcastLineup' => ['CableOrSatelliteService'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'providesBroadcastService' => ['BroadcastService'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'broadcastChannelId', - 'broadcastFrequency', - 'broadcastServiceTier', - 'genre', - 'inBroadcastLineup', - 'providesBroadcastService' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'broadcastChannelId' => ['Text'], - 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], - 'broadcastServiceTier' => ['Text'], - 'genre' => ['Text', 'URL'], - 'inBroadcastLineup' => ['CableOrSatelliteService'], - 'providesBroadcastService' => ['BroadcastService'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', - 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', - 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', - 'providesBroadcastService' => 'The BroadcastService offered on this channel. Inverse property: hasBroadcastChannel.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The unique address by which the BroadcastService can be identified in a - * provider lineup. In US, this is typically a number. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $broadcastChannelId; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', + 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', + 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', + 'description' => 'A description of the item.', + '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.', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'providesBroadcastService' => 'The BroadcastService offered on this channel.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The frequency used for over-the-air broadcasts. Numeric values or simple - * ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences - * of AM and FM radio channels, e.g. "87 FM". - * - * @var mixed|BroadcastFrequencySpecification|string [schema.org types: BroadcastFrequencySpecification, Text] - */ - public $broadcastFrequency; /** - * The type of service required to have access to the channel (e.g. Standard - * or Premium). - * - * @var string [schema.org types: Text] - */ - public $broadcastServiceTier; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * The CableOrSatelliteService offering the channel. - * - * @var CableOrSatelliteService [schema.org types: CableOrSatelliteService] - */ - public $inBroadcastLineup; - /** - * The BroadcastService offered on this channel. Inverse property: - * hasBroadcastChannel. - * - * @var BroadcastService [schema.org types: BroadcastService] + * @inheritdoc */ - public $providesBroadcastService; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['broadcastChannelId', 'broadcastFrequency', 'broadcastServiceTier', 'genre', 'inBroadcastLineup', 'providesBroadcastService'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BroadcastChannelInterface.php b/src/models/jsonld/BroadcastChannelInterface.php new file mode 100644 index 000000000..d52013c14 --- /dev/null +++ b/src/models/jsonld/BroadcastChannelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'broadcastOfEvent' => ['Event'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'free' => ['Boolean'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'isLiveBroadcast' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'publishedBy' => ['Organization', 'Person'], + 'publishedOn' => ['BroadcastService'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'subtitleLanguage' => ['Language', 'Text'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'videoFormat' => ['Text'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'broadcastOfEvent', - 'isLiveBroadcast', - 'subtitleLanguage', - 'videoFormat' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'broadcastOfEvent' => ['Event'], - 'isLiveBroadcast' => ['Boolean'], - 'subtitleLanguage' => ['Language', 'Text'], - 'videoFormat' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'broadcastOfEvent' => 'The event being broadcast such as a sporting event or awards ceremony.', - 'isLiveBroadcast' => 'True is the broadcast is of a live event.', - 'subtitleLanguage' => 'Languages in which subtitles/captions are available, in IETF BCP 47 standard format.', - 'videoFormat' => 'The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'broadcastOfEvent' => 'The event being broadcast such as a sporting event or awards ceremony.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'free' => 'A flag to signal that the item, event, or place is accessible for free.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isLiveBroadcast' => 'True if the broadcast is of a live event.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'publishedBy' => 'An agent associated with the publication event.', + 'publishedOn' => 'A broadcast service associated with the publication event.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'subtitleLanguage' => 'Languages in which subtitles/captions are available, in [IETF BCP 47 standard format](http://tools.ietf.org/html/bcp47).', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'videoFormat' => 'The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The event being broadcast such as a sporting event or awards ceremony. - * - * @var Event [schema.org types: Event] - */ - public $broadcastOfEvent; - /** - * True is the broadcast is of a live event. - * - * @var bool [schema.org types: Boolean] - */ - public $isLiveBroadcast; - /** - * Languages in which subtitles/captions are available, in IETF BCP 47 - * standard format. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $subtitleLanguage; /** - * The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, - * etc.). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $videoFormat; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['broadcastOfEvent', 'isLiveBroadcast', 'subtitleLanguage', 'videoFormat'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BroadcastEventInterface.php b/src/models/jsonld/BroadcastEventInterface.php new file mode 100644 index 000000000..d8f13c449 --- /dev/null +++ b/src/models/jsonld/BroadcastEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'broadcastFrequencyValue' => ['Number', 'QuantitativeValue'], + 'broadcastSignalModulation' => ['QualitativeValue', 'Text'], + 'broadcastSubChannel' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'broadcastFrequencyValue', - 'broadcastSignalModulation', - 'broadcastSubChannel' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'broadcastFrequencyValue' => ['Number', 'QuantitativeValue'], - 'broadcastSignalModulation' => ['QualitativeValue', 'Text'], - 'broadcastSubChannel' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'broadcastFrequencyValue' => 'The frequency in MHz for a particular broadcast.', - 'broadcastSignalModulation' => 'The modulation (e.g. FM, AM, etc) used by a particular broadcast service', - 'broadcastSubChannel' => 'The subchannel used for the broadcast.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'broadcastFrequencyValue' => 'The frequency in MHz for a particular broadcast.', + 'broadcastSignalModulation' => 'The modulation (e.g. FM, AM, etc) used by a particular broadcast service.', + 'broadcastSubChannel' => 'The subchannel used for the broadcast.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The frequency in MHz for a particular broadcast. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $broadcastFrequencyValue; - /** - * The modulation (e.g. FM, AM, etc) used by a particular broadcast service - * - * @var mixed|QualitativeValue|string [schema.org types: QualitativeValue, Text] - */ - public $broadcastSignalModulation; /** - * The subchannel used for the broadcast. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $broadcastSubChannel; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['broadcastFrequencyValue', 'broadcastSignalModulation', 'broadcastSubChannel'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BroadcastFrequencySpecificationInterface.php b/src/models/jsonld/BroadcastFrequencySpecificationInterface.php new file mode 100644 index 000000000..ae979e901 --- /dev/null +++ b/src/models/jsonld/BroadcastFrequencySpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BroadcastReleaseInterface.php b/src/models/jsonld/BroadcastReleaseInterface.php new file mode 100644 index 000000000..6c201f927 --- /dev/null +++ b/src/models/jsonld/BroadcastReleaseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'area' => ['Place'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broadcastAffiliateOf' => ['Organization'], + 'broadcastDisplayName' => ['Text'], + 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], + 'broadcastTimezone' => ['Text'], + 'broadcaster' => ['Organization'], + 'broker' => ['Person', 'Organization'], + 'callSign' => ['Text'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hasBroadcastChannel' => ['BroadcastChannel'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'parentService' => ['BroadcastService'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'], + 'videoFormat' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'broadcastAffiliateOf', - 'broadcastDisplayName', - 'broadcastFrequency', - 'broadcastTimezone', - 'broadcaster', - 'callSign', - 'hasBroadcastChannel', - 'inLanguage', - 'parentService', - 'videoFormat' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'broadcastAffiliateOf' => ['Organization'], - 'broadcastDisplayName' => ['Text'], - 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], - 'broadcastTimezone' => ['Text'], - 'broadcaster' => ['Organization'], - 'callSign' => ['Text'], - 'hasBroadcastChannel' => ['BroadcastChannel'], - 'inLanguage' => ['Language', 'Text'], - 'parentService' => ['BroadcastService'], - 'videoFormat' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'broadcastAffiliateOf' => 'The media network(s) whose content is broadcast on this station.', - 'broadcastDisplayName' => 'The name displayed in the channel guide. For many US affiliates, it is the network name.', - 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', - 'broadcastTimezone' => 'The timezone in ISO 8601 format for which the service bases its broadcasts', - 'broadcaster' => 'The organization owning or operating the broadcast service.', - 'callSign' => 'A callsign, as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', - 'hasBroadcastChannel' => 'A broadcast channel of a broadcast service. Inverse property: providesBroadcastService.', - '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. See also availableLanguage. Supersedes language.', - 'parentService' => 'A broadcast service to which the broadcast service may belong to such as regional variations of a national channel.', - 'videoFormat' => 'The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The media network(s) whose content is broadcast on this station. - * - * @var Organization [schema.org types: Organization] - */ - public $broadcastAffiliateOf; - /** - * The name displayed in the channel guide. For many US affiliates, it is the - * network name. - * - * @var string [schema.org types: Text] - */ - public $broadcastDisplayName; - /** - * The frequency used for over-the-air broadcasts. Numeric values or simple - * ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences - * of AM and FM radio channels, e.g. "87 FM". - * - * @var mixed|BroadcastFrequencySpecification|string [schema.org types: BroadcastFrequencySpecification, Text] - */ - public $broadcastFrequency; - /** - * The timezone in ISO 8601 format for which the service bases its broadcasts - * - * @var string [schema.org types: Text] - */ - public $broadcastTimezone; - /** - * The organization owning or operating the broadcast service. - * - * @var Organization [schema.org types: Organization] + * @inheritdoc */ - public $broadcaster; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'area' => 'The area within which users can expect to reach the broadcast service.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'broadcastAffiliateOf' => 'The media network(s) whose content is broadcast on this station.', + 'broadcastDisplayName' => 'The name displayed in the channel guide. For many US affiliates, it is the network name.', + 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', + 'broadcastTimezone' => 'The timezone in [ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601) for which the service bases its broadcasts', + 'broadcaster' => 'The organization owning or operating the broadcast service.', + '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.', + 'callSign' => 'A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'hasBroadcastChannel' => 'A broadcast channel of a broadcast service.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'parentService' => 'A broadcast service to which the broadcast service may belong to such as regional variations of a national channel.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.', + 'videoFormat' => 'The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A callsign, as used in broadcasting and radio communications to identify - * people, radio and TV stations, or vehicles. - * - * @var string [schema.org types: Text] - */ - public $callSign; /** - * A broadcast channel of a broadcast service. Inverse property: - * providesBroadcastService. - * - * @var BroadcastChannel [schema.org types: BroadcastChannel] - */ - public $hasBroadcastChannel; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A broadcast service to which the broadcast service may belong to such as - * regional variations of a national channel. - * - * @var BroadcastService [schema.org types: BroadcastService] - */ - public $parentService; - /** - * The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, - * etc.). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $videoFormat; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['broadcastAffiliateOf', 'broadcastDisplayName', 'broadcastFrequency', 'broadcastTimezone', 'broadcaster', 'callSign', 'hasBroadcastChannel', 'inLanguage', 'parentService', 'videoFormat'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BroadcastServiceInterface.php b/src/models/jsonld/BroadcastServiceInterface.php new file mode 100644 index 000000000..691e29f2b --- /dev/null +++ b/src/models/jsonld/BroadcastServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'amount' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amount' => ['MonetaryAmount', 'Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amount' => 'The amount of money.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The amount of money. - * - * @var mixed|MonetaryAmount|float [schema.org types: MonetaryAmount, Number] + * @inheritdoc */ - public $amount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BrokerageAccountInterface.php b/src/models/jsonld/BrokerageAccountInterface.php new file mode 100644 index 000000000..c97a28658 --- /dev/null +++ b/src/models/jsonld/BrokerageAccountInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BuddhistTempleInterface.php b/src/models/jsonld/BuddhistTempleInterface.php new file mode 100644 index 000000000..1b1efca89 --- /dev/null +++ b/src/models/jsonld/BuddhistTempleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accelerationTime' => ['QuantitativeValue'], + 'acrissCode' => ['Text'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bodyType' => ['QualitativeValue', 'Text', 'URL'], + 'brand' => ['Organization', 'Brand'], + 'callSign' => ['Text'], + 'cargoVolume' => ['QuantitativeValue'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'dateVehicleFirstRegistered' => ['Date'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'driveWheelConfiguration' => ['Text', 'DriveWheelConfigurationValue'], + 'emissionsCO2' => ['Number'], + 'fuelCapacity' => ['QuantitativeValue'], + 'fuelConsumption' => ['QuantitativeValue'], + 'fuelEfficiency' => ['QuantitativeValue'], + 'fuelType' => ['Text', 'URL', 'QualitativeValue'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knownVehicleDamages' => ['Text'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'meetsEmissionStandard' => ['Text', 'URL', 'QualitativeValue'], + 'mileageFromOdometer' => ['QuantitativeValue'], + 'model' => ['ProductModel', 'Text'], + 'modelDate' => ['Date'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'numberOfAirbags' => ['Text', 'Number'], + 'numberOfAxles' => ['Number', 'QuantitativeValue'], + 'numberOfDoors' => ['QuantitativeValue', 'Number'], + 'numberOfForwardGears' => ['QuantitativeValue', 'Number'], + 'numberOfPreviousOwners' => ['Number', 'QuantitativeValue'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'payload' => ['QuantitativeValue'], + 'potentialAction' => ['Action'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'roofLoad' => ['QuantitativeValue'], + 'sameAs' => ['URL'], + 'seatingCapacity' => ['QuantitativeValue', 'Number'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'speed' => ['QuantitativeValue'], + 'steeringPosition' => ['SteeringPositionValue'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'tongueWeight' => ['QuantitativeValue'], + 'trailerWeight' => ['QuantitativeValue'], + 'url' => ['URL'], + 'vehicleConfiguration' => ['Text'], + 'vehicleEngine' => ['EngineSpecification'], + 'vehicleIdentificationNumber' => ['Text'], + 'vehicleInteriorColor' => ['Text'], + 'vehicleInteriorType' => ['Text'], + 'vehicleModelDate' => ['Date'], + 'vehicleSeatingCapacity' => ['QuantitativeValue', 'Number'], + 'vehicleSpecialUsage' => ['CarUsageType', 'Text'], + 'vehicleTransmission' => ['Text', 'QualitativeValue', 'URL'], + 'weight' => ['QuantitativeValue'], + 'weightTotal' => ['QuantitativeValue'], + 'wheelbase' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acrissCode', - 'roofLoad' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'acrissCode' => ['Text'], - 'roofLoad' => ['QuantitativeValue'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accelerationTime' => 'The time needed to accelerate the vehicle from a given start velocity to a given target velocity. Typical unit code(s): SEC for seconds * Note: There are unfortunately no standard unit codes for seconds/0..100 km/h or seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities in the [[name]] of the [[QuantitativeValue]], or use [[valueReference]] with a [[QuantitativeValue]] of 0..60 mph or 0..100 km/h to specify the reference speeds.', + 'acrissCode' => 'The ACRISS Car Classification Code is a code used by many car rental companies, for classifying vehicles. ACRISS stands for Association of Car Rental Industry Systems and Standards.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bodyType' => 'Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'callSign' => 'A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', + 'cargoVolume' => 'The available volume for cargo or luggage. For automobiles, this is usually the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic foot/feet Note: You can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'dateVehicleFirstRegistered' => 'The date of the first registration of the vehicle with the respective public authorities.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'driveWheelConfiguration' => 'The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle\'s engine via the drivetrain.', + 'emissionsCO2' => 'The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put "g/km" into the unitText property of that value, since there is no UN/CEFACT Common Code for "g/km".', + 'fuelCapacity' => 'The capacity of the fuel tank or in the case of electric cars, the battery. If there are multiple components for storage, this should indicate the total of all storage of the same type. Typical unit code(s): LTR for liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for ampere-hours (for electrical vehicles).', + 'fuelConsumption' => 'The amount of fuel consumed for traveling a particular distance or temporal duration with the given vehicle (e.g. liters per 100 km). * Note 1: There are unfortunately no standard unit codes for liters per 100 km. Use [[unitText]] to indicate the unit of measurement, e.g. L/100 km. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel consumption to another value.', + 'fuelEfficiency' => 'The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers per liter (km/L). * Note 1: There are unfortunately no standard unit codes for miles per gallon or kilometers per liter. Use [[unitText]] to indicate the unit of measurement, e.g. mpg or km/L. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel economy to another value.', + 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'knownVehicleDamages' => 'A textual description of known damages, both repaired and unrepaired.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'meetsEmissionStandard' => 'Indicates that the vehicle meets the respective emission standard.', + 'mileageFromOdometer' => 'The total distance travelled by the particular vehicle since its initial production, as read from its odometer. Typical unit code(s): KMT for kilometers, SMI for statute miles', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'modelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + 'numberOfAirbags' => 'The number or type of airbags in the vehicle.', + 'numberOfAxles' => 'The number of axles. Typical unit code(s): C62', + 'numberOfDoors' => 'The number of doors. Typical unit code(s): C62', + 'numberOfForwardGears' => 'The total number of forward gears available for the transmission system of the vehicle. Typical unit code(s): C62', + 'numberOfPreviousOwners' => 'The number of owners of the vehicle, including the current one. Typical unit code(s): C62', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'payload' => 'The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: Many databases specify the permitted TOTAL weight instead, which is the sum of [[weight]] and [[payload]] * Note 2: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 3: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 4: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + 'roofLoad' => 'The permitted total weight of cargo and installations (e.g. a roof rack) on top of the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]] * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + '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.', + 'seatingCapacity' => 'The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons ', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'speed' => 'The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit of the speed range (indicated by [[maxValue]] should be the maximum speed achievable under regular conditions. Typical unit code(s): KMH for km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use [[minValue]] and [[maxValue]] to indicate the range. Typically, the minimal value is zero. * Note 2: There are many different ways of measuring the speed range. You can link to information about how the given value has been determined using the [[valueReference]] property.', + 'steeringPosition' => 'The position of the steering wheel or similar device (mostly for cars).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'tongueWeight' => 'The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'trailerWeight' => 'The permitted weight of a trailer attached to the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'url' => 'URL of the item.', + 'vehicleConfiguration' => 'A short text indicating the configuration of the vehicle, e.g. \'5dr hatchback ST 2.5 MT 225 hp\' or \'limited edition\'.', + 'vehicleEngine' => 'Information about the engine or engines of the vehicle.', + 'vehicleIdentificationNumber' => 'The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles.', + 'vehicleInteriorColor' => 'The color or color combination of the interior of the vehicle.', + 'vehicleInteriorType' => 'The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.). While most interior types are characterized by the material used, an interior type can also be based on vehicle usage or target audience.', + 'vehicleModelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'vehicleSeatingCapacity' => 'The number of passengers that can be seated in the vehicle, both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons.', + 'vehicleSpecialUsage' => 'Indicates whether the vehicle has been used for special purposes, like commercial rental, driving school, or as a taxi. The legislation in many countries requires this information to be revealed when offering a car for sale.', + 'vehicleTransmission' => 'The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars).', + 'weight' => 'The weight of the product or person.', + 'weightTotal' => 'The permitted total weight of the loaded vehicle, including passengers and cargo and the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'wheelbase' => 'The distance between the centers of the front and rear wheels. Typical unit code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet', + 'width' => 'The width of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acrissCode' => 'The ACRISS Car Classification Code is a code used by many car rental companies, for classifying vehicles. ACRISS stands for Association of Car Rental Industry Systems and Standards.', - 'roofLoad' => 'The permitted total weight of cargo and installations (e.g. a roof rack) on top of the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can indicate additional information in the name of the QuantitativeValue node. Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference Note 3: Note that you can use minValue and maxValue to indicate ranges.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The ACRISS Car Classification Code is a code used by many car rental - * companies, for classifying vehicles. ACRISS stands for Association of Car - * Rental Industry Systems and Standards. - * - * @var string [schema.org types: Text] - */ - public $acrissCode; - /** - * The permitted total weight of cargo and installations (e.g. a roof rack) on - * top of the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound - * Note 1: You can indicate additional information in the name of the - * QuantitativeValue node. Note 2: You may also link to a QualitativeValue - * node that provides additional information using valueReference Note 3: Note - * that you can use minValue and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $roofLoad; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acrissCode', 'roofLoad'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BusOrCoachInterface.php b/src/models/jsonld/BusOrCoachInterface.php new file mode 100644 index 000000000..4f19b45da --- /dev/null +++ b/src/models/jsonld/BusOrCoachInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bookingTime', - 'broker', - 'modifiedTime', - 'priceCurrency', - 'programMembershipUsed', - 'provider', - 'reservationFor', - 'reservationId', - 'reservationStatus', - 'reservedTicket', - 'totalPrice', - 'underName' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bookingTime' => ['DateTime'], - 'broker' => ['Organization', 'Person'], - 'modifiedTime' => ['DateTime'], - 'priceCurrency' => ['Text'], - 'programMembershipUsed' => ['ProgramMembership'], - 'provider' => ['Organization', 'Person'], - 'reservationFor' => ['Thing'], - 'reservationId' => ['Text'], - 'reservationStatus' => ['ReservationStatusType'], - 'reservedTicket' => ['Ticket'], - 'totalPrice' => ['Number', 'PriceSpecification', 'Text'], - 'underName' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bookingTime' => 'The date and time the reservation was booked.', - '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. Supersedes bookingAgent.', - 'modifiedTime' => 'The date and time the reservation was modified.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', - '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. Supersedes carrier.', - 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', - 'reservationId' => 'A unique identifier for the reservation.', - 'reservationStatus' => 'The current status of the reservation.', - 'reservedTicket' => 'A ticket associated with the reservation.', - '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 similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'underName' => 'The person or organization the reservation or ticket is for.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The date and time the reservation was booked. - * - * @var DateTime [schema.org types: DateTime] - */ - public $bookingTime; /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * The date and time the reservation was modified. - * - * @var DateTime [schema.org types: DateTime] - */ - public $modifiedTime; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; - /** - * Any membership in a frequent flyer, hotel loyalty program, etc. being - * applied to the reservation. - * - * @var ProgramMembership [schema.org types: ProgramMembership] - */ - public $programMembershipUsed; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * The thing -- flight, event, restaurant,etc. being reserved. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $reservationFor; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A unique identifier for the reservation. - * - * @var string [schema.org types: Text] - */ - public $reservationId; - /** - * The current status of the reservation. - * - * @var ReservationStatusType [schema.org types: ReservationStatusType] - */ - public $reservationStatus; - /** - * A ticket associated with the reservation. - * - * @var Ticket [schema.org types: Ticket] - */ - public $reservedTicket; - /** - * 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 similiar - * Unicode symbols. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to - * indicate a decimal point. Avoid using these symbols as a readability - * separator. - * - * @var mixed|float|PriceSpecification|string [schema.org types: Number, PriceSpecification, Text] - */ - public $totalPrice; /** - * The person or organization the reservation or ticket is for. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $underName; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bookingTime', 'broker', 'modifiedTime', 'priceCurrency', 'programMembershipUsed', 'provider', 'reservationFor', 'reservationId', 'reservationStatus', 'reservedTicket', 'totalPrice', 'underName'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BusReservationInterface.php b/src/models/jsonld/BusReservationInterface.php new file mode 100644 index 000000000..3747e8d4f --- /dev/null +++ b/src/models/jsonld/BusReservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BusStationInterface.php b/src/models/jsonld/BusStationInterface.php new file mode 100644 index 000000000..a5b1df8b6 --- /dev/null +++ b/src/models/jsonld/BusStationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BusStopInterface.php b/src/models/jsonld/BusStopInterface.php new file mode 100644 index 000000000..21342ea33 --- /dev/null +++ b/src/models/jsonld/BusStopInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'arrivalBusStop' => ['BusStation', 'BusStop'], + 'arrivalTime' => ['Time', 'DateTime'], + 'busName' => ['Text'], + 'busNumber' => ['Text'], + 'departureBusStop' => ['BusStop', 'BusStation'], + 'departureTime' => ['Time', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itinerary' => ['ItemList', 'Place'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfTrip' => ['Trip'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'sameAs' => ['URL'], + 'subTrip' => ['Trip'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'arrivalBusStop', - 'busName', - 'busNumber', - 'departureBusStop' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'arrivalBusStop' => ['BusStation', 'BusStop'], - 'busName' => ['Text'], - 'busNumber' => ['Text'], - 'departureBusStop' => ['BusStation', 'BusStop'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'arrivalBusStop' => 'The stop or station from which the bus arrives.', - 'busName' => 'The name of the bus (e.g. Bolt Express).', - 'busNumber' => 'The unique identifier for the bus.', - 'departureBusStop' => 'The stop or station from which the bus departs.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'arrivalBusStop' => 'The stop or station from which the bus arrives.', + 'arrivalTime' => 'The expected arrival time.', + 'busName' => 'The name of the bus (e.g. Bolt Express).', + 'busNumber' => 'The unique identifier for the bus.', + 'departureBusStop' => 'The stop or station from which the bus departs.', + 'departureTime' => 'The expected departure time.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itinerary' => 'Destination(s) ( [[Place]] ) that make up a trip. For a trip where destination order is important use [[ItemList]] to specify that order (see examples).', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'partOfTrip' => 'Identifies that this [[Trip]] is a subTrip of another Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + '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.', + 'subTrip' => 'Identifies a [[Trip]] that is a subTrip of this Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The stop or station from which the bus arrives. - * - * @var mixed|BusStation|BusStop [schema.org types: BusStation, BusStop] - */ - public $arrivalBusStop; - /** - * The name of the bus (e.g. Bolt Express). - * - * @var string [schema.org types: Text] - */ - public $busName; - /** - * The unique identifier for the bus. - * - * @var string [schema.org types: Text] - */ - public $busNumber; /** - * The stop or station from which the bus departs. - * - * @var mixed|BusStation|BusStop [schema.org types: BusStation, BusStop] + * @inheritdoc */ - public $departureBusStop; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['arrivalBusStop', 'busName', 'busNumber', 'departureBusStop'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BusTripInterface.php b/src/models/jsonld/BusTripInterface.php new file mode 100644 index 000000000..f487c4004 --- /dev/null +++ b/src/models/jsonld/BusTripInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'audienceType' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'geographicArea' => ['AdministrativeArea'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'yearlyRevenue' => ['QuantitativeValue'], + 'yearsInOperation' => ['QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'numberOfEmployees', - 'yearlyRevenue', - 'yearsInOperation' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'numberOfEmployees' => ['QuantitativeValue'], - 'yearlyRevenue' => ['QuantitativeValue'], - 'yearsInOperation' => ['QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'yearlyRevenue' => 'The size of the business in annual revenue.', - 'yearsInOperation' => 'The age of the business.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'audienceType' => 'The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).', + 'description' => 'A description of the item.', + '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.', + 'geographicArea' => 'The geographic area associated with the audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'yearlyRevenue' => 'The size of the business in annual revenue.', + 'yearsInOperation' => 'The age of the business.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * The size of the business in annual revenue. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $yearlyRevenue; /** - * The age of the business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $yearsInOperation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['numberOfEmployees', 'yearlyRevenue', 'yearsInOperation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BusinessAudienceInterface.php b/src/models/jsonld/BusinessAudienceInterface.php new file mode 100644 index 000000000..8318b0f8b --- /dev/null +++ b/src/models/jsonld/BusinessAudienceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BusinessEntityTypeInterface.php b/src/models/jsonld/BusinessEntityTypeInterface.php new file mode 100644 index 000000000..31827c33d --- /dev/null +++ b/src/models/jsonld/BusinessEntityTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BusinessEventInterface.php b/src/models/jsonld/BusinessEventInterface.php new file mode 100644 index 000000000..6ec1f3d52 --- /dev/null +++ b/src/models/jsonld/BusinessEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BusinessFunctionInterface.php b/src/models/jsonld/BusinessFunctionInterface.php new file mode 100644 index 000000000..dfc27bd3d --- /dev/null +++ b/src/models/jsonld/BusinessFunctionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/BusinessSupportInterface.php b/src/models/jsonld/BusinessSupportInterface.php new file mode 100644 index 000000000..f4ac7c87c --- /dev/null +++ b/src/models/jsonld/BusinessSupportInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'seller' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'], + 'vendor' => ['Person', 'Organization'], + 'warrantyPromise' => ['WarrantyPromise'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'seller' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.', + 'vendor' => '\'vendor\' is an earlier term for \'seller\'.', + 'warrantyPromise' => 'The warranty promise(s) included in the offer.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'seller' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider. Supersedes merchant, vendor.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An entity which offers (sells / leases / lends / loans) the services / - * goods. A seller may also be a provider. Supersedes merchant, vendor. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $seller; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['seller'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/BuyActionInterface.php b/src/models/jsonld/BuyActionInterface.php new file mode 100644 index 000000000..f35227b0c --- /dev/null +++ b/src/models/jsonld/BuyActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'cvdCollectionDate' => ['DateTime', 'Text'], + 'cvdFacilityCounty' => ['Text'], + 'cvdFacilityId' => ['Text'], + 'cvdNumBeds' => ['Number'], + 'cvdNumBedsOcc' => ['Number'], + 'cvdNumC19Died' => ['Number'], + 'cvdNumC19HOPats' => ['Number'], + 'cvdNumC19HospPats' => ['Number'], + 'cvdNumC19MechVentPats' => ['Number'], + 'cvdNumC19OFMechVentPats' => ['Number'], + 'cvdNumC19OverflowPats' => ['Number'], + 'cvdNumICUBeds' => ['Number'], + 'cvdNumICUBedsOcc' => ['Number'], + 'cvdNumTotBeds' => ['Number'], + 'cvdNumVent' => ['Number'], + 'cvdNumVentUse' => ['Number'], + 'datePosted' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cvdCollectionDate', - 'cvdNumBeds', - 'cvdNumBedsOcc', - 'cvdNumC19Died', - 'cvdNumC19HOPats', - 'cvdNumC19HospPats', - 'cvdNumC19MechVentPats', - 'cvdNumC19OFMechVentPats', - 'cvdNumC19OverflowPats', - 'cvdNumICUBeds', - 'cvdNumICUBedsOcc', - 'cvdNumTotBeds', - 'cvdNumVent', - 'cvdNumVentUse', - 'datePosted' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'cvdCollectionDate' => ['DateTime', 'Text'], - 'cvdNumBeds' => ['Number'], - 'cvdNumBedsOcc' => ['Number'], - 'cvdNumC19Died' => ['Number'], - 'cvdNumC19HOPats' => ['Number'], - 'cvdNumC19HospPats' => ['Number'], - 'cvdNumC19MechVentPats' => ['Number'], - 'cvdNumC19OFMechVentPats' => ['Number'], - 'cvdNumC19OverflowPats' => ['Number'], - 'cvdNumICUBeds' => ['Number'], - 'cvdNumICUBedsOcc' => ['Number'], - 'cvdNumTotBeds' => ['Number'], - 'cvdNumVent' => ['Number'], - 'cvdNumVentUse' => ['Number'], - 'datePosted' => ['Date', 'DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cvdCollectionDate' => 'collectiondate - Date for which patient counts are reported.', - 'cvdNumBeds' => 'numbeds - HOSPITAL INPATIENT BEDS: Inpatient beds, including all staffed, licensed, and overflow (surge) beds used for inpatients.', - 'cvdNumBedsOcc' => 'numbedsocc - HOSPITAL INPATIENT BED OCCUPANCY: Total number of staffed inpatient beds that are occupied.', - 'cvdNumC19Died' => 'numc19died - DEATHS: Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location.', - 'cvdNumC19HOPats' => 'numc19hopats - HOSPITAL ONSET: Patients hospitalized in an NHSN inpatient care location with onset of suspected or confirmed COVID-19 14 or more days after hospitalization.', - 'cvdNumC19HospPats' => 'numc19hosppats - HOSPITALIZED: Patients currently hospitalized in an inpatient care location who have suspected or confirmed COVID-19.', - 'cvdNumC19MechVentPats' => 'numc19mechventpats - HOSPITALIZED and VENTILATED: Patients hospitalized in an NHSN inpatient care location who have suspected or confirmed COVID-19 and are on a mechanical ventilator.', - 'cvdNumC19OFMechVentPats' => 'numc19ofmechventpats - ED/OVERFLOW and VENTILATED: Patients with suspected or confirmed COVID-19 who are in the ED or any overflow location awaiting an inpatient bed and on a mechanical ventilator.', - 'cvdNumC19OverflowPats' => 'numc19overflowpats - ED/OVERFLOW: Patients with suspected or confirmed COVID-19 who are in the ED or any overflow location awaiting an inpatient bed.', - 'cvdNumICUBeds' => 'numicubeds - ICU BEDS: Total number of staffed inpatient intensive care unit (ICU) beds.', - 'cvdNumICUBedsOcc' => 'numicubedsocc - ICU BED OCCUPANCY: Total number of staffed inpatient ICU beds that are occupied.', - 'cvdNumTotBeds' => 'numtotbeds - ALL HOSPITAL BEDS: Total number of all Inpatient and outpatient beds, including all staffed,ICU, licensed, and overflow (surge) beds used for inpatients or outpatients.', - 'cvdNumVent' => 'numvent - MECHANICAL VENTILATORS: Total number of ventilators available.', - 'cvdNumVentUse' => 'numventuse - MECHANICAL VENTILATORS IN USE: Total number of ventilators in use.', - 'datePosted' => 'Publication date of an online listing.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * collectiondate - Date for which patient counts are reported. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $cvdCollectionDate; - /** - * numbeds - HOSPITAL INPATIENT BEDS: Inpatient beds, including all staffed, - * licensed, and overflow (surge) beds used for inpatients. - * - * @var float [schema.org types: Number] - */ - public $cvdNumBeds; - /** - * numbedsocc - HOSPITAL INPATIENT BED OCCUPANCY: Total number of staffed - * inpatient beds that are occupied. - * - * @var float [schema.org types: Number] - */ - public $cvdNumBedsOcc; - /** - * numc19died - DEATHS: Patients with suspected or confirmed COVID-19 who died - * in the hospital, ED, or any overflow location. - * - * @var float [schema.org types: Number] - */ - public $cvdNumC19Died; - /** - * numc19hopats - HOSPITAL ONSET: Patients hospitalized in an NHSN inpatient - * care location with onset of suspected or confirmed COVID-19 14 or more days - * after hospitalization. - * - * @var float [schema.org types: Number] - */ - public $cvdNumC19HOPats; - /** - * numc19hosppats - HOSPITALIZED: Patients currently hospitalized in an - * inpatient care location who have suspected or confirmed COVID-19. - * - * @var float [schema.org types: Number] - */ - public $cvdNumC19HospPats; - /** - * numc19mechventpats - HOSPITALIZED and VENTILATED: Patients hospitalized in - * an NHSN inpatient care location who have suspected or confirmed COVID-19 - * and are on a mechanical ventilator. - * - * @var float [schema.org types: Number] - */ - public $cvdNumC19MechVentPats; - /** - * numc19ofmechventpats - ED/OVERFLOW and VENTILATED: Patients with suspected - * or confirmed COVID-19 who are in the ED or any overflow location awaiting - * an inpatient bed and on a mechanical ventilator. - * - * @var float [schema.org types: Number] - */ - public $cvdNumC19OFMechVentPats; - /** - * numc19overflowpats - ED/OVERFLOW: Patients with suspected or confirmed - * COVID-19 who are in the ED or any overflow location awaiting an inpatient - * bed. - * - * @var float [schema.org types: Number] - */ - public $cvdNumC19OverflowPats; - /** - * numicubeds - ICU BEDS: Total number of staffed inpatient intensive care - * unit (ICU) beds. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $cvdNumICUBeds; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'cvdCollectionDate' => 'collectiondate - Date for which patient counts are reported.', + 'cvdFacilityCounty' => 'Name of the County of the NHSN facility that this data record applies to. Use [[cvdFacilityId]] to identify the facility. To provide other details, [[healthcareReportingData]] can be used on a [[Hospital]] entry.', + 'cvdFacilityId' => 'Identifier of the NHSN facility that this data record applies to. Use [[cvdFacilityCounty]] to indicate the county. To provide other details, [[healthcareReportingData]] can be used on a [[Hospital]] entry.', + 'cvdNumBeds' => 'numbeds - HOSPITAL INPATIENT BEDS: Inpatient beds, including all staffed, licensed, and overflow (surge) beds used for inpatients.', + 'cvdNumBedsOcc' => 'numbedsocc - HOSPITAL INPATIENT BED OCCUPANCY: Total number of staffed inpatient beds that are occupied.', + 'cvdNumC19Died' => 'numc19died - DEATHS: Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location.', + 'cvdNumC19HOPats' => 'numc19hopats - HOSPITAL ONSET: Patients hospitalized in an NHSN inpatient care location with onset of suspected or confirmed COVID-19 14 or more days after hospitalization.', + 'cvdNumC19HospPats' => 'numc19hosppats - HOSPITALIZED: Patients currently hospitalized in an inpatient care location who have suspected or confirmed COVID-19.', + 'cvdNumC19MechVentPats' => 'numc19mechventpats - HOSPITALIZED and VENTILATED: Patients hospitalized in an NHSN inpatient care location who have suspected or confirmed COVID-19 and are on a mechanical ventilator.', + 'cvdNumC19OFMechVentPats' => 'numc19ofmechventpats - ED/OVERFLOW and VENTILATED: Patients with suspected or confirmed COVID-19 who are in the ED or any overflow location awaiting an inpatient bed and on a mechanical ventilator.', + 'cvdNumC19OverflowPats' => 'numc19overflowpats - ED/OVERFLOW: Patients with suspected or confirmed COVID-19 who are in the ED or any overflow location awaiting an inpatient bed.', + 'cvdNumICUBeds' => 'numicubeds - ICU BEDS: Total number of staffed inpatient intensive care unit (ICU) beds.', + 'cvdNumICUBedsOcc' => 'numicubedsocc - ICU BED OCCUPANCY: Total number of staffed inpatient ICU beds that are occupied.', + 'cvdNumTotBeds' => 'numtotbeds - ALL HOSPITAL BEDS: Total number of all Inpatient and outpatient beds, including all staffed,ICU, licensed, and overflow (surge) beds used for inpatients or outpatients.', + 'cvdNumVent' => 'numvent - MECHANICAL VENTILATORS: Total number of ventilators available.', + 'cvdNumVentUse' => 'numventuse - MECHANICAL VENTILATORS IN USE: Total number of ventilators in use.', + 'datePosted' => 'Publication date of an online listing.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * numicubedsocc - ICU BED OCCUPANCY: Total number of staffed inpatient ICU - * beds that are occupied. - * - * @var float [schema.org types: Number] - */ - public $cvdNumICUBedsOcc; - /** - * numtotbeds - ALL HOSPITAL BEDS: Total number of all Inpatient and - * outpatient beds, including all staffed,ICU, licensed, and overflow (surge) - * beds used for inpatients or outpatients. - * - * @var float [schema.org types: Number] - */ - public $cvdNumTotBeds; - /** - * numvent - MECHANICAL VENTILATORS: Total number of ventilators available. - * - * @var float [schema.org types: Number] - */ - public $cvdNumVent; /** - * numventuse - MECHANICAL VENTILATORS IN USE: Total number of ventilators in - * use. - * - * @var float [schema.org types: Number] - */ - public $cvdNumVentUse; - /** - * Publication date of an online listing. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $datePosted; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cvdCollectionDate', 'cvdNumBeds', 'cvdNumBedsOcc', 'cvdNumC19Died', 'cvdNumC19HOPats', 'cvdNumC19HospPats', 'cvdNumC19MechVentPats', 'cvdNumC19OFMechVentPats', 'cvdNumC19OverflowPats', 'cvdNumICUBeds', 'cvdNumICUBedsOcc', 'cvdNumTotBeds', 'cvdNumVent', 'cvdNumVentUse', 'datePosted'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CDCPMDRecordInterface.php b/src/models/jsonld/CDCPMDRecordInterface.php new file mode 100644 index 000000000..476037c41 --- /dev/null +++ b/src/models/jsonld/CDCPMDRecordInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CDFormatInterface.php b/src/models/jsonld/CDFormatInterface.php new file mode 100644 index 000000000..d1401c77e --- /dev/null +++ b/src/models/jsonld/CDFormatInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CTInterface.php b/src/models/jsonld/CTInterface.php new file mode 100644 index 000000000..b0f16ab51 --- /dev/null +++ b/src/models/jsonld/CTInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'aggregateRating', - 'areaServed', - 'audience', - 'availableChannel', - 'award', - 'brand', - 'broker', - 'category', - 'hasOfferCatalog', - 'hoursAvailable', - 'isRelatedTo', - 'isSimilarTo', - 'logo', - 'offers', - 'provider', - 'providerMobility', - 'review', - 'serviceOutput', - 'serviceType', - 'slogan', - 'termsOfService' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'aggregateRating' => ['AggregateRating'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'audience' => ['Audience'], - 'availableChannel' => ['ServiceChannel'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'broker' => ['Organization', 'Person'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hoursAvailable' => ['OpeningHoursSpecification'], - 'isRelatedTo' => ['Product', 'Service'], - 'isSimilarTo' => ['Product', 'Service'], - 'logo' => ['ImageObject', 'URL'], - 'offers' => ['Demand', 'Offer'], - 'provider' => ['Organization', 'Person'], - 'providerMobility' => ['Text'], - 'review' => ['Review'], - 'serviceOutput' => ['Thing'], - 'serviceType' => ['Text'], - 'slogan' => ['Text'], - 'termsOfService' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - '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. Supersedes bookingAgent.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hoursAvailable' => 'The hours during which this service or contact is available.', - 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', - 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', - 'logo' => 'An associated logo.', - '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. Inverse property: itemOffered.', - '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. Supersedes carrier.', - 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', - 'review' => 'A review of the item. Supersedes reviews.', - 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc. Supersedes produces.', - 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', - 'slogan' => 'A slogan or motto associated with the item.', - 'termsOfService' => 'Human-readable terms of service documentation.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A means of accessing the service (e.g. a phone bank, a web site, a - * location, etc.). - * - * @var ServiceChannel [schema.org types: ServiceChannel] - */ - public $availableChannel; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * The hours during which this service or contact is available. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $hoursAvailable; - /** - * A pointer to another, somehow related product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isRelatedTo; - /** - * A pointer to another, functionally similar product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isSimilarTo; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * Indicates the mobility of a provided service (e.g. 'static', 'dynamic'). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $providerMobility; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * The tangible thing generated by the service, e.g. a passport, permit, etc. - * Supersedes produces. - * - * @var Thing [schema.org types: Thing] - */ - public $serviceOutput; - /** - * The type of service being offered, e.g. veterans' benefits, emergency - * relief, etc. - * - * @var string [schema.org types: Text] - */ - public $serviceType; /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Human-readable terms of service documentation. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $termsOfService; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['aggregateRating', 'areaServed', 'audience', 'availableChannel', 'award', 'brand', 'broker', 'category', 'hasOfferCatalog', 'hoursAvailable', 'isRelatedTo', 'isSimilarTo', 'logo', 'offers', 'provider', 'providerMobility', 'review', 'serviceOutput', 'serviceType', 'slogan', 'termsOfService'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CableOrSatelliteServiceInterface.php b/src/models/jsonld/CableOrSatelliteServiceInterface.php new file mode 100644 index 000000000..aa489b216 --- /dev/null +++ b/src/models/jsonld/CableOrSatelliteServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CafeOrCoffeeShopInterface.php b/src/models/jsonld/CafeOrCoffeeShopInterface.php new file mode 100644 index 000000000..769a1b748 --- /dev/null +++ b/src/models/jsonld/CafeOrCoffeeShopInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableLanguage' => ['Text', 'Language'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'checkinTime' => ['DateTime', 'Time'], + 'checkoutTime' => ['DateTime', 'Time'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'checkinTime' => 'The earliest someone may check into a lodging establishment.', + 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CampgroundInterface.php b/src/models/jsonld/CampgroundInterface.php new file mode 100644 index 000000000..556f0e762 --- /dev/null +++ b/src/models/jsonld/CampgroundInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationCategory' => ['Text'], + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'floorLevel' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'permittedUsage' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'], + 'yearBuilt' => ['Number'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accommodationCategory', - 'accommodationFloorPlan', - 'amenityFeature', - 'floorLevel', - 'floorSize', - 'leaseLength', - 'numberOfBathroomsTotal', - 'numberOfBedrooms', - 'numberOfFullBathrooms', - 'numberOfPartialBathrooms', - 'numberOfRooms', - 'permittedUsage', - 'petsAllowed', - 'tourBookingPage', - 'yearBuilt' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accommodationCategory' => ['Text'], - 'accommodationFloorPlan' => ['FloorPlan'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'floorLevel' => ['Text'], - 'floorSize' => ['QuantitativeValue'], - 'leaseLength' => ['Duration', 'QuantitativeValue'], - 'numberOfBathroomsTotal' => ['Integer'], - 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], - 'numberOfFullBathrooms' => ['Number'], - 'numberOfPartialBathrooms' => ['Number'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'permittedUsage' => ['Text'], - 'petsAllowed' => ['Boolean', 'Text'], - 'tourBookingPage' => ['URL'], - 'yearBuilt' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accommodationCategory' => 'Category of an Accommodation, following real estate conventions e.g. RESO (see PropertySubType, and PropertyType fields for suggested values).', - 'accommodationFloorPlan' => 'A floorplan of some Accommodation.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'floorLevel' => 'The floor level for an Accommodation in a multi-storey building. Since counting systems vary internationally, the local system should be used where possible.', - 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard', - 'leaseLength' => 'Length of the lease for some Accommodation, either particular to some Offer or in some cases intrinsic to the property.', - 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some Accommodation, following real estate conventions as documented in RESO: "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also numberOfRooms.', - 'numberOfBedrooms' => 'The total integer number of bedrooms in a some Accommodation, ApartmentComplex or FloorPlan.', - 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an Accommodation. This corresponds to the BathroomsFull field in RESO.', - 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an Accommodation. This corresponds to the BathroomsPartial field in RESO.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.', - 'yearBuilt' => 'The year an Accommodation was constructed. This corresponds to the YearBuilt field in RESO.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Category of an Accommodation, following real estate conventions e.g. RESO - * (see PropertySubType, and PropertyType fields for suggested values). - * - * @var string [schema.org types: Text] - */ - public $accommodationCategory; - /** - * A floorplan of some Accommodation. - * - * @var FloorPlan [schema.org types: FloorPlan] - */ - public $accommodationFloorPlan; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * The floor level for an Accommodation in a multi-storey building. Since - * counting systems vary internationally, the local system should be used - * where possible. - * - * @var string [schema.org types: Text] - */ - public $floorLevel; - /** - * The size of the accommodation, e.g. in square meter or squarefoot. Typical - * unit code(s): MTK for square meter, FTK for square foot, or YDK for square - * yard - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $floorSize; - /** - * Length of the lease for some Accommodation, either particular to some Offer - * or in some cases intrinsic to the property. - * - * @var mixed|Duration|QuantitativeValue [schema.org types: Duration, QuantitativeValue] - */ - public $leaseLength; - /** - * The total integer number of bathrooms in a some Accommodation, following - * real estate conventions as documented in RESO: "The simple sum of the - * number of bathrooms. For example for a property with two Full Bathrooms and - * one Half Bathroom, the Bathrooms Total Integer will be 3.". See also - * numberOfRooms. - * - * @var int [schema.org types: Integer] - */ - public $numberOfBathroomsTotal; - /** - * The total integer number of bedrooms in a some Accommodation, - * ApartmentComplex or FloorPlan. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfBedrooms; - /** - * Number of full bathrooms - The total number of full and ¾ bathrooms in an - * Accommodation. This corresponds to the BathroomsFull field in RESO. - * - * @var float [schema.org types: Number] - */ - public $numberOfFullBathrooms; - /** - * Number of partial bathrooms - The total number of half and ¼ bathrooms in - * an Accommodation. This corresponds to the BathroomsPartial field in RESO. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $numberOfPartialBathrooms; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationCategory' => 'Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values).', + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'floorLevel' => 'The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.', + 'yearBuilt' => 'The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). ' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; - /** - * Indications regarding the permitted usage of the accommodation. - * - * @var string [schema.org types: Text] - */ - public $permittedUsage; - /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] - */ - public $tourBookingPage; - /** - * The year an Accommodation was constructed. This corresponds to the - * YearBuilt field in RESO. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $yearBuilt; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accommodationCategory', 'accommodationFloorPlan', 'amenityFeature', 'floorLevel', 'floorSize', 'leaseLength', 'numberOfBathroomsTotal', 'numberOfBedrooms', 'numberOfFullBathrooms', 'numberOfPartialBathrooms', 'numberOfRooms', 'permittedUsage', 'petsAllowed', 'tourBookingPage', 'yearBuilt'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CampingPitchInterface.php b/src/models/jsonld/CampingPitchInterface.php new file mode 100644 index 000000000..2ee14a8d4 --- /dev/null +++ b/src/models/jsonld/CampingPitchInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place. The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number. The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. The International Standard of Industrial Classification - * of All Economic Activities (ISIC), Revision 4 code for a particular - * organization, business person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CanalInterface.php b/src/models/jsonld/CanalInterface.php new file mode 100644 index 000000000..6007316dc --- /dev/null +++ b/src/models/jsonld/CanalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'scheduledTime' => ['DateTime'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'scheduledTime' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'scheduledTime' => 'The time the object is scheduled to.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'scheduledTime' => ['DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'scheduledTime' => 'The time the object is scheduled to.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The time the object is scheduled to. - * - * @var DateTime [schema.org types: DateTime] + * @inheritdoc */ - public $scheduledTime; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['scheduledTime'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CancelActionInterface.php b/src/models/jsonld/CancelActionInterface.php new file mode 100644 index 000000000..dd275b7a0 --- /dev/null +++ b/src/models/jsonld/CancelActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accelerationTime' => ['QuantitativeValue'], + 'acrissCode' => ['Text'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bodyType' => ['QualitativeValue', 'Text', 'URL'], + 'brand' => ['Organization', 'Brand'], + 'callSign' => ['Text'], + 'cargoVolume' => ['QuantitativeValue'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'dateVehicleFirstRegistered' => ['Date'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'driveWheelConfiguration' => ['Text', 'DriveWheelConfigurationValue'], + 'emissionsCO2' => ['Number'], + 'fuelCapacity' => ['QuantitativeValue'], + 'fuelConsumption' => ['QuantitativeValue'], + 'fuelEfficiency' => ['QuantitativeValue'], + 'fuelType' => ['Text', 'URL', 'QualitativeValue'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knownVehicleDamages' => ['Text'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'meetsEmissionStandard' => ['Text', 'URL', 'QualitativeValue'], + 'mileageFromOdometer' => ['QuantitativeValue'], + 'model' => ['ProductModel', 'Text'], + 'modelDate' => ['Date'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'numberOfAirbags' => ['Text', 'Number'], + 'numberOfAxles' => ['Number', 'QuantitativeValue'], + 'numberOfDoors' => ['QuantitativeValue', 'Number'], + 'numberOfForwardGears' => ['QuantitativeValue', 'Number'], + 'numberOfPreviousOwners' => ['Number', 'QuantitativeValue'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'payload' => ['QuantitativeValue'], + 'potentialAction' => ['Action'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'roofLoad' => ['QuantitativeValue'], + 'sameAs' => ['URL'], + 'seatingCapacity' => ['QuantitativeValue', 'Number'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'speed' => ['QuantitativeValue'], + 'steeringPosition' => ['SteeringPositionValue'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'tongueWeight' => ['QuantitativeValue'], + 'trailerWeight' => ['QuantitativeValue'], + 'url' => ['URL'], + 'vehicleConfiguration' => ['Text'], + 'vehicleEngine' => ['EngineSpecification'], + 'vehicleIdentificationNumber' => ['Text'], + 'vehicleInteriorColor' => ['Text'], + 'vehicleInteriorType' => ['Text'], + 'vehicleModelDate' => ['Date'], + 'vehicleSeatingCapacity' => ['QuantitativeValue', 'Number'], + 'vehicleSpecialUsage' => ['CarUsageType', 'Text'], + 'vehicleTransmission' => ['Text', 'QualitativeValue', 'URL'], + 'weight' => ['QuantitativeValue'], + 'weightTotal' => ['QuantitativeValue'], + 'wheelbase' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acrissCode', - 'roofLoad' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'acrissCode' => ['Text'], - 'roofLoad' => ['QuantitativeValue'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accelerationTime' => 'The time needed to accelerate the vehicle from a given start velocity to a given target velocity. Typical unit code(s): SEC for seconds * Note: There are unfortunately no standard unit codes for seconds/0..100 km/h or seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities in the [[name]] of the [[QuantitativeValue]], or use [[valueReference]] with a [[QuantitativeValue]] of 0..60 mph or 0..100 km/h to specify the reference speeds.', + 'acrissCode' => 'The ACRISS Car Classification Code is a code used by many car rental companies, for classifying vehicles. ACRISS stands for Association of Car Rental Industry Systems and Standards.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bodyType' => 'Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'callSign' => 'A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', + 'cargoVolume' => 'The available volume for cargo or luggage. For automobiles, this is usually the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic foot/feet Note: You can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'dateVehicleFirstRegistered' => 'The date of the first registration of the vehicle with the respective public authorities.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'driveWheelConfiguration' => 'The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle\'s engine via the drivetrain.', + 'emissionsCO2' => 'The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put "g/km" into the unitText property of that value, since there is no UN/CEFACT Common Code for "g/km".', + 'fuelCapacity' => 'The capacity of the fuel tank or in the case of electric cars, the battery. If there are multiple components for storage, this should indicate the total of all storage of the same type. Typical unit code(s): LTR for liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for ampere-hours (for electrical vehicles).', + 'fuelConsumption' => 'The amount of fuel consumed for traveling a particular distance or temporal duration with the given vehicle (e.g. liters per 100 km). * Note 1: There are unfortunately no standard unit codes for liters per 100 km. Use [[unitText]] to indicate the unit of measurement, e.g. L/100 km. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel consumption to another value.', + 'fuelEfficiency' => 'The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers per liter (km/L). * Note 1: There are unfortunately no standard unit codes for miles per gallon or kilometers per liter. Use [[unitText]] to indicate the unit of measurement, e.g. mpg or km/L. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel economy to another value.', + 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'knownVehicleDamages' => 'A textual description of known damages, both repaired and unrepaired.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'meetsEmissionStandard' => 'Indicates that the vehicle meets the respective emission standard.', + 'mileageFromOdometer' => 'The total distance travelled by the particular vehicle since its initial production, as read from its odometer. Typical unit code(s): KMT for kilometers, SMI for statute miles', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'modelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + 'numberOfAirbags' => 'The number or type of airbags in the vehicle.', + 'numberOfAxles' => 'The number of axles. Typical unit code(s): C62', + 'numberOfDoors' => 'The number of doors. Typical unit code(s): C62', + 'numberOfForwardGears' => 'The total number of forward gears available for the transmission system of the vehicle. Typical unit code(s): C62', + 'numberOfPreviousOwners' => 'The number of owners of the vehicle, including the current one. Typical unit code(s): C62', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'payload' => 'The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: Many databases specify the permitted TOTAL weight instead, which is the sum of [[weight]] and [[payload]] * Note 2: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 3: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 4: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + 'roofLoad' => 'The permitted total weight of cargo and installations (e.g. a roof rack) on top of the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]] * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + '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.', + 'seatingCapacity' => 'The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons ', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'speed' => 'The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit of the speed range (indicated by [[maxValue]] should be the maximum speed achievable under regular conditions. Typical unit code(s): KMH for km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use [[minValue]] and [[maxValue]] to indicate the range. Typically, the minimal value is zero. * Note 2: There are many different ways of measuring the speed range. You can link to information about how the given value has been determined using the [[valueReference]] property.', + 'steeringPosition' => 'The position of the steering wheel or similar device (mostly for cars).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'tongueWeight' => 'The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'trailerWeight' => 'The permitted weight of a trailer attached to the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'url' => 'URL of the item.', + 'vehicleConfiguration' => 'A short text indicating the configuration of the vehicle, e.g. \'5dr hatchback ST 2.5 MT 225 hp\' or \'limited edition\'.', + 'vehicleEngine' => 'Information about the engine or engines of the vehicle.', + 'vehicleIdentificationNumber' => 'The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles.', + 'vehicleInteriorColor' => 'The color or color combination of the interior of the vehicle.', + 'vehicleInteriorType' => 'The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.). While most interior types are characterized by the material used, an interior type can also be based on vehicle usage or target audience.', + 'vehicleModelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'vehicleSeatingCapacity' => 'The number of passengers that can be seated in the vehicle, both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons.', + 'vehicleSpecialUsage' => 'Indicates whether the vehicle has been used for special purposes, like commercial rental, driving school, or as a taxi. The legislation in many countries requires this information to be revealed when offering a car for sale.', + 'vehicleTransmission' => 'The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars).', + 'weight' => 'The weight of the product or person.', + 'weightTotal' => 'The permitted total weight of the loaded vehicle, including passengers and cargo and the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'wheelbase' => 'The distance between the centers of the front and rear wheels. Typical unit code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet', + 'width' => 'The width of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acrissCode' => 'The ACRISS Car Classification Code is a code used by many car rental companies, for classifying vehicles. ACRISS stands for Association of Car Rental Industry Systems and Standards.', - 'roofLoad' => 'The permitted total weight of cargo and installations (e.g. a roof rack) on top of the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can indicate additional information in the name of the QuantitativeValue node. Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference Note 3: Note that you can use minValue and maxValue to indicate ranges.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The ACRISS Car Classification Code is a code used by many car rental - * companies, for classifying vehicles. ACRISS stands for Association of Car - * Rental Industry Systems and Standards. - * - * @var string [schema.org types: Text] - */ - public $acrissCode; - /** - * The permitted total weight of cargo and installations (e.g. a roof rack) on - * top of the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound - * Note 1: You can indicate additional information in the name of the - * QuantitativeValue node. Note 2: You may also link to a QualitativeValue - * node that provides additional information using valueReference Note 3: Note - * that you can use minValue and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $roofLoad; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acrissCode', 'roofLoad'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CarInterface.php b/src/models/jsonld/CarInterface.php new file mode 100644 index 000000000..664891fe7 --- /dev/null +++ b/src/models/jsonld/CarInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'equal', - 'greater', - 'greaterOrEqual', - 'lesser', - 'lesserOrEqual', - 'nonEqual', - 'valueReference' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'equal' => ['QualitativeValue'], - 'greater' => ['QualitativeValue'], - 'greaterOrEqual' => ['QualitativeValue'], - 'lesser' => ['QualitativeValue'], - 'lesserOrEqual' => ['QualitativeValue'], - 'nonEqual' => ['QualitativeValue'], - 'valueReference' => ['Enumeration', 'PropertyValue', 'QualitativeValue', 'QuantitativeValue', 'StructuredValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', - 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', - 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', - 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', - 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', - 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', - 'valueReference' => 'A pointer to a secondary value that provides additional information on the original value, e.g. a reference temperature.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * This ordering relation for qualitative values indicates that the subject is - * equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $equal; - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] + * @inheritdoc */ - public $greater; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $greaterOrEqual; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesser; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesserOrEqual; /** - * This ordering relation for qualitative values indicates that the subject is - * not equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $nonEqual; - /** - * A pointer to a secondary value that provides additional information on the - * original value, e.g. a reference temperature. - * - * @var mixed|Enumeration|PropertyValue|QualitativeValue|QuantitativeValue|StructuredValue [schema.org types: Enumeration, PropertyValue, QualitativeValue, QuantitativeValue, StructuredValue] + * @inheritdoc */ - public $valueReference; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'equal', 'greater', 'greaterOrEqual', 'lesser', 'lesserOrEqual', 'nonEqual', 'valueReference'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CarUsageTypeInterface.php b/src/models/jsonld/CarUsageTypeInterface.php new file mode 100644 index 000000000..23a0af6bc --- /dev/null +++ b/src/models/jsonld/CarUsageTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CardiovascularExam.php b/src/models/jsonld/CardiovascularExam.php index 87806c7ff..8a3986967 100644 --- a/src/models/jsonld/CardiovascularExam.php +++ b/src/models/jsonld/CardiovascularExam.php @@ -1,28 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CardiovascularExamInterface.php b/src/models/jsonld/CardiovascularExamInterface.php new file mode 100644 index 000000000..42e8c4b97 --- /dev/null +++ b/src/models/jsonld/CardiovascularExamInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CaseSeriesInterface.php b/src/models/jsonld/CaseSeriesInterface.php new file mode 100644 index 000000000..7ba0287e8 --- /dev/null +++ b/src/models/jsonld/CaseSeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CasinoInterface.php b/src/models/jsonld/CasinoInterface.php new file mode 100644 index 000000000..53acd7b95 --- /dev/null +++ b/src/models/jsonld/CasinoInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CassetteFormatInterface.php b/src/models/jsonld/CassetteFormatInterface.php new file mode 100644 index 000000000..1d88880ad --- /dev/null +++ b/src/models/jsonld/CassetteFormatInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'codeValue' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inCodeSet' => ['CategoryCodeSet', 'URL'], + 'inDefinedTermSet' => ['URL', 'DefinedTermSet'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termCode' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'codeValue', - 'inCodeSet' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'codeValue' => ['Text'], - 'inCodeSet' => ['CategoryCodeSet', 'URL'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'codeValue' => 'A short textual code that uniquely identifies the value.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inCodeSet' => 'A [[CategoryCodeSet]] that contains this category code.', + 'inDefinedTermSet' => 'A [[DefinedTermSet]] that contains this term.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termCode' => 'A code that identifies this [[DefinedTerm]] within a [[DefinedTermSet]]', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'codeValue' => 'A short textual code that uniquely identifies the value.', - 'inCodeSet' => 'A CategoryCodeSet that contains this category code.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A short textual code that uniquely identifies the value. - * - * @var string [schema.org types: Text] - */ - public $codeValue; - /** - * A CategoryCodeSet that contains this category code. - * - * @var mixed|CategoryCodeSet|string [schema.org types: CategoryCodeSet, URL] + * @inheritdoc */ - public $inCodeSet; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['codeValue', 'inCodeSet'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CategoryCodeInterface.php b/src/models/jsonld/CategoryCodeInterface.php new file mode 100644 index 000000000..620df461d --- /dev/null +++ b/src/models/jsonld/CategoryCodeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasCategoryCode' => ['CategoryCode'], + 'hasDefinedTerm' => ['DefinedTerm'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'hasCategoryCode' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasCategoryCode' => 'A Category code contained in this code set.', + 'hasDefinedTerm' => 'A Defined Term contained in this term set.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasCategoryCode' => ['CategoryCode'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasCategoryCode' => 'A Category code contained in this code set.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A Category code contained in this code set. - * - * @var CategoryCode [schema.org types: CategoryCode] + * @inheritdoc */ - public $hasCategoryCode; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasCategoryCode'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CategoryCodeSetInterface.php b/src/models/jsonld/CategoryCodeSetInterface.php new file mode 100644 index 000000000..34104cfcc --- /dev/null +++ b/src/models/jsonld/CategoryCodeSetInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CatholicChurchInterface.php b/src/models/jsonld/CatholicChurchInterface.php new file mode 100644 index 000000000..d2e43cb13 --- /dev/null +++ b/src/models/jsonld/CatholicChurchInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CausesHealthAspectInterface.php b/src/models/jsonld/CausesHealthAspectInterface.php new file mode 100644 index 000000000..c8aa0c5c8 --- /dev/null +++ b/src/models/jsonld/CausesHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CemeteryInterface.php b/src/models/jsonld/CemeteryInterface.php new file mode 100644 index 000000000..da13b814b --- /dev/null +++ b/src/models/jsonld/CemeteryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'pageEnd', - 'pageStart', - 'pagination' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'pageEnd' => ['Integer', 'Text'], - 'pageStart' => ['Integer', 'Text'], - 'pagination' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', - 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', - 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The page on which the work ends; for example "138" or "xvi". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageEnd; - /** - * The page on which the work starts; for example "135" or "xiii". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageStart; /** - * Any description of pages that is not separated into pageStart and pageEnd; - * for example, "1-6, 9, 55" or "10-12, 46-49". - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $pagination; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['pageEnd', 'pageStart', 'pagination'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ChapterInterface.php b/src/models/jsonld/ChapterInterface.php new file mode 100644 index 000000000..b05ce2c51 --- /dev/null +++ b/src/models/jsonld/ChapterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/CharitableIncorporatedOrganizationInterface.php b/src/models/jsonld/CharitableIncorporatedOrganizationInterface.php new file mode 100644 index 000000000..37826e559 --- /dev/null +++ b/src/models/jsonld/CharitableIncorporatedOrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CheckActionInterface.php b/src/models/jsonld/CheckActionInterface.php new file mode 100644 index 000000000..e7a7ae59a --- /dev/null +++ b/src/models/jsonld/CheckActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'inLanguage', - 'recipient' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'inLanguage' => ['Language', 'Text'], - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. See also availableLanguage. Supersedes language.', - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'inLanguage', 'recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CheckInActionInterface.php b/src/models/jsonld/CheckInActionInterface.php new file mode 100644 index 000000000..88f5c0f12 --- /dev/null +++ b/src/models/jsonld/CheckInActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'inLanguage', - 'recipient' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'inLanguage' => ['Language', 'Text'], - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. See also availableLanguage. Supersedes language.', - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'inLanguage', 'recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CheckOutActionInterface.php b/src/models/jsonld/CheckOutActionInterface.php new file mode 100644 index 000000000..6e9086fd0 --- /dev/null +++ b/src/models/jsonld/CheckOutActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CheckoutPageInterface.php b/src/models/jsonld/CheckoutPageInterface.php new file mode 100644 index 000000000..04c2ed3b7 --- /dev/null +++ b/src/models/jsonld/CheckoutPageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedDisease' => ['URL', 'PropertyValue', 'MedicalCondition'], + 'bioChemInteraction' => ['BioChemEntity'], + 'bioChemSimilarity' => ['BioChemEntity'], + 'biologicalRole' => ['DefinedTerm'], + 'chemicalComposition' => ['Text'], + 'chemicalRole' => ['DefinedTerm'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'hasBioChemEntityPart' => ['BioChemEntity'], + 'hasMolecularFunction' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'hasRepresentation' => ['Text', 'PropertyValue', 'URL'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isEncodedByBioChemEntity' => ['Gene'], + 'isInvolvedInBiologicalProcess' => ['PropertyValue', 'URL', 'DefinedTerm'], + 'isLocatedInSubcellularLocation' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'isPartOfBioChemEntity' => ['BioChemEntity'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'potentialUse' => ['DefinedTerm'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxonomicRange' => ['URL', 'DefinedTerm', 'Text', 'Taxon'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + '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.', + 'bioChemInteraction' => 'A BioChemEntity that is known to interact with this item.', + 'bioChemSimilarity' => 'A similar BioChemEntity, e.g., obtained by fingerprint similarity algorithms.', + 'biologicalRole' => 'A role played by the BioChemEntity within a biological context.', + 'chemicalComposition' => 'The chemical composition describes the identity and relative ratio of the chemical elements that make up the substance.', + 'chemicalRole' => 'A role played by the BioChemEntity within a chemical context.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'hasBioChemEntityPart' => 'Indicates a BioChemEntity that (in some sense) has this BioChemEntity as a part. ', + 'hasMolecularFunction' => 'Molecular function performed by this BioChemEntity; please use PropertyValue if you want to include any evidence.', + 'hasRepresentation' => 'A common representation such as a protein sequence or chemical structure for this entity. For images use schema.org/image.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isEncodedByBioChemEntity' => 'Another BioChemEntity encoding by this one.', + 'isInvolvedInBiologicalProcess' => 'Biological process this BioChemEntity is involved in; please use PropertyValue if you want to include any evidence.', + 'isLocatedInSubcellularLocation' => 'Subcellular location where this BioChemEntity is located; please use PropertyValue if you want to include any evidence.', + 'isPartOfBioChemEntity' => 'Indicates a BioChemEntity that is (in some sense) a part of this BioChemEntity. ', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'potentialUse' => 'Intended use of the BioChemEntity by humans.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxonomicRange' => 'The taxonomic grouping of the organism that expresses, encodes, or in someway related to the BioChemEntity.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ChemicalSubstanceInterface.php b/src/models/jsonld/ChemicalSubstanceInterface.php new file mode 100644 index 000000000..f1d5358ea --- /dev/null +++ b/src/models/jsonld/ChemicalSubstanceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ChildCareInterface.php b/src/models/jsonld/ChildCareInterface.php new file mode 100644 index 000000000..777fd9dbf --- /dev/null +++ b/src/models/jsonld/ChildCareInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ChildrensEventInterface.php b/src/models/jsonld/ChildrensEventInterface.php new file mode 100644 index 000000000..5c63fe2eb --- /dev/null +++ b/src/models/jsonld/ChildrensEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ChiropracticInterface.php b/src/models/jsonld/ChiropracticInterface.php new file mode 100644 index 000000000..eb5b0d988 --- /dev/null +++ b/src/models/jsonld/ChiropracticInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionOption' => ['Thing', 'Text'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'option' => ['Text', 'Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'actionOption' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionOption' => 'A sub property of object. The options subject to this action.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'option' => 'A sub property of object. The options subject to this action.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionOption' => ['Text', 'Thing'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionOption' => 'A sub property of object. The options subject to this action. Supersedes option.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of object. The options subject to this action. Supersedes - * option. - * - * @var mixed|string|Thing [schema.org types: Text, Thing] + * @inheritdoc */ - public $actionOption; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionOption'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ChooseActionInterface.php b/src/models/jsonld/ChooseActionInterface.php new file mode 100644 index 000000000..775c1587c --- /dev/null +++ b/src/models/jsonld/ChooseActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ChurchInterface.php b/src/models/jsonld/ChurchInterface.php new file mode 100644 index 000000000..8d363e10f --- /dev/null +++ b/src/models/jsonld/ChurchInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CityHall.php b/src/models/jsonld/CityHall.php index 272945977..b6654aa3b 100644 --- a/src/models/jsonld/CityHall.php +++ b/src/models/jsonld/CityHall.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CityHallInterface.php b/src/models/jsonld/CityHallInterface.php new file mode 100644 index 000000000..0e93e1fae --- /dev/null +++ b/src/models/jsonld/CityHallInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CivicStructureInterface.php b/src/models/jsonld/CivicStructureInterface.php new file mode 100644 index 000000000..b3c720067 --- /dev/null +++ b/src/models/jsonld/CivicStructureInterface.php @@ -0,0 +1,24 @@ +. * If a business is + * open 7 days a week, then it can be specified as . + * + * @var string|Text + */ + public $openingHours; + +} diff --git a/src/models/jsonld/Claim.php b/src/models/jsonld/Claim.php index e1722e2dc..9ec20805f 100644 --- a/src/models/jsonld/Claim.php +++ b/src/models/jsonld/Claim.php @@ -1,38 +1,39 @@ getSchemaPropertyExpectedTypes()); + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'appearance', - 'firstAppearance' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'appearance' => ['CreativeWork'], - 'firstAppearance' => ['CreativeWork'] - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'appearance' => ['CreativeWork'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'claimInterpreter' => ['Person', 'Organization'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'firstAppearance' => ['CreativeWork'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'appearance' => 'Indicates an occurence of a Claim in some CreativeWork.', - 'firstAppearance' => 'Indicates the first known occurence of a Claim in some CreativeWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates an occurence of a Claim in some CreativeWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $appearance; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'appearance' => 'Indicates an occurence of a [[Claim]] in some [[CreativeWork]].', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'claimInterpreter' => 'For a [[Claim]] interpreted from [[MediaObject]] content sed to indicate a claim contained, implied or refined from the content of a [[MediaObject]].', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'firstAppearance' => 'Indicates the first known occurence of a [[Claim]] in some [[CreativeWork]].', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + /** - * Indicates the first known occurence of a Claim in some CreativeWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $firstAppearance; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['appearance', 'firstAppearance'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ClaimInterface.php b/src/models/jsonld/ClaimInterface.php new file mode 100644 index 000000000..45f9760f8 --- /dev/null +++ b/src/models/jsonld/ClaimInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedClaimReview' => ['Review'], + 'associatedMedia' => ['MediaObject'], + 'associatedMediaReview' => ['Review'], + 'associatedReview' => ['Review'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'claimReviewed' => ['Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'itemReviewed' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'negativeNotes' => ['ListItem', 'Text', 'WebContent', 'ItemList'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'positiveNotes' => ['WebContent', 'Text', 'ListItem', 'ItemList'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewAspect' => ['Text'], + 'reviewBody' => ['Text'], + 'reviewRating' => ['Rating'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'claimReviewed' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedClaimReview' => 'An associated [[ClaimReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'associatedMediaReview' => 'An associated [[MediaReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedReview' => 'An associated [[Review]].', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'claimReviewed' => 'A short summary of the specific claims reviewed in a ClaimReview.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'negativeNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), negative considerations - either as unstructured text, or a list.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'positiveNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), positive considerations - either as unstructured text, or a list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewBody' => 'The actual body of the review.', + 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating``` applies to rating given by the review. The [[aggregateRating]] property applies to the review itself, as a creative work.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'claimReviewed' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'claimReviewed' => 'A short summary of the specific claims reviewed in a ClaimReview.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A short summary of the specific claims reviewed in a ClaimReview. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $claimReviewed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['claimReviewed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ClaimReviewInterface.php b/src/models/jsonld/ClaimReviewInterface.php new file mode 100644 index 000000000..635916441 --- /dev/null +++ b/src/models/jsonld/ClaimReviewInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/CleaningFeeInterface.php b/src/models/jsonld/CleaningFeeInterface.php new file mode 100644 index 000000000..f7fe05705 --- /dev/null +++ b/src/models/jsonld/CleaningFeeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ClinicianInterface.php b/src/models/jsonld/ClinicianInterface.php new file mode 100644 index 000000000..33f8a6a37 --- /dev/null +++ b/src/models/jsonld/ClinicianInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'clipNumber' => ['Text', 'Integer'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endOffset' => ['Number', 'HyperTocEntry'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfEpisode' => ['Episode'], + 'partOfSeason' => ['CreativeWorkSeason'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startOffset' => ['Number', 'HyperTocEntry'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'clipNumber', - 'director', - 'endOffset', - 'musicBy', - 'partOfEpisode', - 'partOfSeason', - 'partOfSeries', - 'startOffset' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'clipNumber' => ['Integer', 'Text'], - 'director' => ['Person'], - 'endOffset' => ['Number'], - 'musicBy' => ['MusicGroup', 'Person'], - 'partOfEpisode' => ['Episode'], - 'partOfSeason' => ['CreativeWorkSeason'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'startOffset' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'clipNumber' => 'Position of the clip within an ordered group of clips.', - '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. Supersedes directors.', - 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', - 'musicBy' => 'The composer of the soundtrack.', - 'partOfEpisode' => 'The episode to which this clip belongs.', - 'partOfSeason' => 'The season to which this episode belongs.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * Position of the clip within an ordered group of clips. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $clipNumber; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The end time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $endOffset; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'clipNumber' => 'Position of the clip within an ordered group of clips.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'partOfEpisode' => 'The episode to which this clip belongs.', + 'partOfSeason' => 'The season to which this episode belongs.', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The episode to which this clip belongs. - * - * @var Episode [schema.org types: Episode] - */ - public $partOfEpisode; - /** - * The season to which this episode belongs. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $partOfSeason; - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; - /** - * The start time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $startOffset; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'clipNumber', 'director', 'endOffset', 'musicBy', 'partOfEpisode', 'partOfSeason', 'partOfSeries', 'startOffset'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ClipInterface.php b/src/models/jsonld/ClipInterface.php new file mode 100644 index 000000000..2ce6a4c6e --- /dev/null +++ b/src/models/jsonld/ClipInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ClothingStoreInterface.php b/src/models/jsonld/ClothingStoreInterface.php new file mode 100644 index 000000000..7cd9570b1 --- /dev/null +++ b/src/models/jsonld/ClothingStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CoOpInterface.php b/src/models/jsonld/CoOpInterface.php new file mode 100644 index 000000000..2b61d2966 --- /dev/null +++ b/src/models/jsonld/CoOpInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/CodeInterface.php b/src/models/jsonld/CodeInterface.php new file mode 100644 index 000000000..4b31e70e8 --- /dev/null +++ b/src/models/jsonld/CodeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CohortStudyInterface.php b/src/models/jsonld/CohortStudyInterface.php new file mode 100644 index 000000000..29e8c5c89 --- /dev/null +++ b/src/models/jsonld/CohortStudyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'collectionSize' => ['Integer'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'collectionSize' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'collectionSize' => 'The number of items in the [[Collection]].', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'collectionSize' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'collectionSize' => 'The number of items in the Collection.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of items in the Collection. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $collectionSize; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['collectionSize'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CollectionInterface.php b/src/models/jsonld/CollectionInterface.php new file mode 100644 index 000000000..c0dd2cf41 --- /dev/null +++ b/src/models/jsonld/CollectionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CollectionPageInterface.php b/src/models/jsonld/CollectionPageInterface.php new file mode 100644 index 000000000..87ba58121 --- /dev/null +++ b/src/models/jsonld/CollectionPageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'alumni' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'alumni' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $alumni; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['alumni'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CollegeOrUniversityInterface.php b/src/models/jsonld/CollegeOrUniversityInterface.php new file mode 100644 index 000000000..f32e88e4b --- /dev/null +++ b/src/models/jsonld/CollegeOrUniversityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ComedyClubInterface.php b/src/models/jsonld/ComedyClubInterface.php new file mode 100644 index 000000000..fd4702cf6 --- /dev/null +++ b/src/models/jsonld/ComedyClubInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ComedyEventInterface.php b/src/models/jsonld/ComedyEventInterface.php new file mode 100644 index 000000000..57ba7969e --- /dev/null +++ b/src/models/jsonld/ComedyEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'artEdition' => ['Integer', 'Text'], + 'artMedium' => ['URL', 'Text'], + 'artform' => ['Text', 'URL'], + 'artist' => ['Person'], + 'artworkSurface' => ['URL', 'Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'colorist' => ['Person'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'inker' => ['Person'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'letterer' => ['Person'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'penciler' => ['Person'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'surface' => ['URL', 'Text'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'artist', - 'colorist', - 'inker', - 'letterer', - 'penciler' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'artist' => ['Person'], - 'colorist' => ['Person'], - 'inker' => ['Person'], - 'letterer' => ['Person'], - 'penciler' => ['Person'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', - 'colorist' => 'The individual who adds color to inked drawings.', - 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', - 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', - 'penciler' => 'The individual who draws the primary narrative artwork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'artEdition' => 'The number of copies when multiple copies of a piece of artwork are produced - e.g. for a limited edition of 20 prints, \'artEdition\' refers to the total number of copies (in this example "20").', + 'artMedium' => 'The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.)', + 'artform' => 'e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, etc.', + 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', + 'artworkSurface' => 'The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'colorist' => 'The individual who adds color to inked drawings.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'penciler' => 'The individual who draws the primary narrative artwork.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'surface' => 'A material used as a surface in some artwork, e.g. Canvas, Paper, Wood, Board, etc.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The primary artist for a work in a medium other than pencils or digital - * line art--for example, if the primary artwork is done in watercolors or - * digital paints. - * - * @var Person [schema.org types: Person] - */ - public $artist; - /** - * The individual who adds color to inked drawings. - * - * @var Person [schema.org types: Person] - */ - public $colorist; - /** - * The individual who traces over the pencil drawings in ink after pencils are - * complete. - * - * @var Person [schema.org types: Person] - */ - public $inker; - /** - * The individual who adds lettering, including speech balloons and sound - * effects, to artwork. - * - * @var Person [schema.org types: Person] - */ - public $letterer; - /** - * The individual who draws the primary narrative artwork. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $penciler; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['artist', 'colorist', 'inker', 'letterer', 'penciler'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ComicCoverArtInterface.php b/src/models/jsonld/ComicCoverArtInterface.php new file mode 100644 index 000000000..3e668e40f --- /dev/null +++ b/src/models/jsonld/ComicCoverArtInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'artist' => ['Person'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'colorist' => ['Person'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'inker' => ['Person'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issueNumber' => ['Integer', 'Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'letterer' => ['Person'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'penciler' => ['Person'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'variantCover' => ['Text'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'artist', - 'colorist', - 'inker', - 'letterer', - 'penciler', - 'variantCover' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'artist' => ['Person'], - 'colorist' => ['Person'], - 'inker' => ['Person'], - 'letterer' => ['Person'], - 'penciler' => ['Person'], - 'variantCover' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', - 'colorist' => 'The individual who adds color to inked drawings.', - 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', - 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', - 'penciler' => 'The individual who draws the primary narrative artwork.', - 'variantCover' => 'A description of the variant cover for the issue, if the issue is a variant printing. For example, "Bryan Hitch Variant Cover" or "2nd Printing Variant".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The primary artist for a work in a medium other than pencils or digital - * line art--for example, if the primary artwork is done in watercolors or - * digital paints. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $artist; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'colorist' => 'The individual who adds color to inked drawings.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issueNumber' => 'Identifies the issue of publication; for example, "iii" or "2".', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'penciler' => 'The individual who draws the primary narrative artwork.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'variantCover' => 'A description of the variant cover for the issue, if the issue is a variant printing. For example, "Bryan Hitch Variant Cover" or "2nd Printing Variant".', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The individual who adds color to inked drawings. - * - * @var Person [schema.org types: Person] - */ - public $colorist; /** - * The individual who traces over the pencil drawings in ink after pencils are - * complete. - * - * @var Person [schema.org types: Person] - */ - public $inker; - /** - * The individual who adds lettering, including speech balloons and sound - * effects, to artwork. - * - * @var Person [schema.org types: Person] - */ - public $letterer; - /** - * The individual who draws the primary narrative artwork. - * - * @var Person [schema.org types: Person] - */ - public $penciler; - /** - * A description of the variant cover for the issue, if the issue is a variant - * printing. For example, "Bryan Hitch Variant Cover" or "2nd Printing - * Variant". - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $variantCover; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['artist', 'colorist', 'inker', 'letterer', 'penciler', 'variantCover'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ComicIssueInterface.php b/src/models/jsonld/ComicIssueInterface.php new file mode 100644 index 000000000..fe034a627 --- /dev/null +++ b/src/models/jsonld/ComicIssueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'endDate', - 'issn', - 'startDate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'endDate' => ['Date', 'DateTime'], - 'issn' => ['Text'], - 'startDate' => ['Date', 'DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The International Standard Serial Number (ISSN) that identifies this serial - * publication. You can repeat this property to identify different formats of, - * or the linking ISSN (ISSN-L) for, this serial publication. - * - * @var string [schema.org types: Text] - */ - public $issn; /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $startDate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['endDate', 'issn', 'startDate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ComicSeriesInterface.php b/src/models/jsonld/ComicSeriesInterface.php new file mode 100644 index 000000000..a97477887 --- /dev/null +++ b/src/models/jsonld/ComicSeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'artist' => ['Person'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'colorist' => ['Person'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'inker' => ['Person'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'letterer' => ['Person'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'penciler' => ['Person'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'artist', - 'colorist', - 'inker', - 'letterer', - 'penciler' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'artist' => ['Person'], - 'colorist' => ['Person'], - 'inker' => ['Person'], - 'letterer' => ['Person'], - 'penciler' => ['Person'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', - 'colorist' => 'The individual who adds color to inked drawings.', - 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', - 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', - 'penciler' => 'The individual who draws the primary narrative artwork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'colorist' => 'The individual who adds color to inked drawings.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'penciler' => 'The individual who draws the primary narrative artwork.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The primary artist for a work in a medium other than pencils or digital - * line art--for example, if the primary artwork is done in watercolors or - * digital paints. - * - * @var Person [schema.org types: Person] - */ - public $artist; - /** - * The individual who adds color to inked drawings. - * - * @var Person [schema.org types: Person] - */ - public $colorist; - /** - * The individual who traces over the pencil drawings in ink after pencils are - * complete. - * - * @var Person [schema.org types: Person] - */ - public $inker; - /** - * The individual who adds lettering, including speech balloons and sound - * effects, to artwork. - * - * @var Person [schema.org types: Person] - */ - public $letterer; - /** - * The individual who draws the primary narrative artwork. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $penciler; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['artist', 'colorist', 'inker', 'letterer', 'penciler'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ComicStoryInterface.php b/src/models/jsonld/ComicStoryInterface.php new file mode 100644 index 000000000..d0755aaea --- /dev/null +++ b/src/models/jsonld/ComicStoryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'downvoteCount' => ['Integer'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'parentItem' => ['Comment'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'upvoteCount' => ['Integer'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'downvoteCount', - 'parentItem', - 'upvoteCount' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'downvoteCount' => ['Integer'], - 'parentItem' => ['Question'], - 'upvoteCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'downvoteCount' => 'The number of downvotes this question, answer or comment has received from the community.', - 'parentItem' => 'The parent of a question, answer or item in general.', - 'upvoteCount' => 'The number of upvotes this question, answer or comment has received from the community.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'downvoteCount' => 'The number of downvotes this question, answer or comment has received from the community.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'parentItem' => 'The parent of a question, answer or item in general.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'upvoteCount' => 'The number of upvotes this question, answer or comment has received from the community.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of downvotes this question, answer or comment has received from - * the community. - * - * @var int [schema.org types: Integer] - */ - public $downvoteCount; - /** - * The parent of a question, answer or item in general. - * - * @var Question [schema.org types: Question] - */ - public $parentItem; /** - * The number of upvotes this question, answer or comment has received from - * the community. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $upvoteCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['downvoteCount', 'parentItem', 'upvoteCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CommentAction.php b/src/models/jsonld/CommentAction.php index f319c2b03..b44f6a94a 100644 --- a/src/models/jsonld/CommentAction.php +++ b/src/models/jsonld/CommentAction.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'resultComment' => ['Comment'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'resultComment' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + 'resultComment' => 'A sub property of result. The Comment created or sent as a result of this action.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'resultComment' => ['Comment'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'resultComment' => 'A sub property of result. The Comment created or sent as a result of this action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of result. The Comment created or sent as a result of this - * action. - * - * @var Comment [schema.org types: Comment] + * @inheritdoc */ - public $resultComment; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['resultComment'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CommentActionInterface.php b/src/models/jsonld/CommentActionInterface.php new file mode 100644 index 000000000..bd972edfc --- /dev/null +++ b/src/models/jsonld/CommentActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CommentPermissionInterface.php b/src/models/jsonld/CommentPermissionInterface.php new file mode 100644 index 000000000..9de1ba956 --- /dev/null +++ b/src/models/jsonld/CommentPermissionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'inLanguage', - 'recipient' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'inLanguage' => ['Language', 'Text'], - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. See also availableLanguage. Supersedes language.', - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'inLanguage', 'recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CommunicateActionInterface.php b/src/models/jsonld/CommunicateActionInterface.php new file mode 100644 index 000000000..1fd2dc94f --- /dev/null +++ b/src/models/jsonld/CommunicateActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CommunityHealthInterface.php b/src/models/jsonld/CommunityHealthInterface.php new file mode 100644 index 000000000..faaa5d3ac --- /dev/null +++ b/src/models/jsonld/CommunityHealthInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CompilationAlbumInterface.php b/src/models/jsonld/CompilationAlbumInterface.php new file mode 100644 index 000000000..811c6695a --- /dev/null +++ b/src/models/jsonld/CompilationAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'catalog' => ['DataCatalog'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dataFeedElement' => ['Thing', 'DataFeedItem', 'Text'], + 'datasetTimeInterval' => ['DateTime'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'distribution' => ['DataDownload'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'includedDataCatalog' => ['DataCatalog'], + 'includedInDataCatalog' => ['DataCatalog'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'measurementTechnique' => ['Text', 'URL'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'variableMeasured' => ['PropertyValue', 'Text'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'dataFeedElement' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'catalog' => 'A data catalog which contains this dataset.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dataFeedElement' => 'An item within in a data feed. Data feeds may have many elements.', + 'datasetTimeInterval' => 'The range of temporal applicability of a dataset, e.g. for a 2011 census dataset, the year 2011 (in ISO 8601 time interval format).', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'distribution' => 'A downloadable form of this dataset, at a specific location, in a specific format.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'includedDataCatalog' => 'A data catalog which contains this dataset (this property was previously \'catalog\', preferred name is now \'includedInDataCatalog\').', + 'includedInDataCatalog' => 'A data catalog which contains this dataset.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'measurementTechnique' => 'A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]), corresponding to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]]). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if [[variableMeasured]] is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the [[variableMeasured]] is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several [[variableMeasured]] properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]]. ', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'variableMeasured' => 'The variableMeasured property can indicate (repeated as necessary) the variables that are measured in some dataset, either described as text or as pairs of identifier and description using PropertyValue.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dataFeedElement' => ['DataFeedItem', 'Text', 'Thing'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dataFeedElement' => 'An item within in a data feed. Data feeds may have many elements.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An item within in a data feed. Data feeds may have many elements. - * - * @var mixed|DataFeedItem|string|Thing [schema.org types: DataFeedItem, Text, Thing] + * @inheritdoc */ - public $dataFeedElement; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dataFeedElement'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CompleteDataFeedInterface.php b/src/models/jsonld/CompleteDataFeedInterface.php new file mode 100644 index 000000000..fec1d1bda --- /dev/null +++ b/src/models/jsonld/CompleteDataFeedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CompletedActionStatus.php b/src/models/jsonld/CompletedActionStatus.php index 44e13e2c0..d84314547 100644 --- a/src/models/jsonld/CompletedActionStatus.php +++ b/src/models/jsonld/CompletedActionStatus.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CompletedActionStatusInterface.php b/src/models/jsonld/CompletedActionStatusInterface.php new file mode 100644 index 000000000..d5f4e6de3 --- /dev/null +++ b/src/models/jsonld/CompletedActionStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxPrice' => ['Number'], + 'minPrice' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceComponent' => ['UnitPriceSpecification'], + 'priceCurrency' => ['Text'], + 'priceType' => ['PriceTypeEnumeration', 'Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'valueAddedTaxIncluded' => ['Boolean'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'priceComponent' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maxPrice' => 'The highest price if the price is a range.', + 'minPrice' => 'The lowest price if the price is a range.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + 'priceComponent' => 'This property links to all [[UnitPriceSpecification]] nodes that apply in parallel for the [[CompoundPriceSpecification]] node.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceType' => 'Defines the type of a price specified for an offered product, for example a list price, a (temporary) sale price or a manufacturer suggested retail price. If multiple prices are specified for an offer the [[priceType]] property can be used to identify the type of each such specified price. The value of priceType can be specified as a value from enumeration PriceTypeEnumeration or as a free form text string for price types that are not already predefined in PriceTypeEnumeration.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'valueAddedTaxIncluded' => 'Specifies whether the applicable value-added tax (VAT) is included in the price specification or not.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'priceComponent' => ['UnitPriceSpecification'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'priceComponent' => 'This property links to all UnitPriceSpecification nodes that apply in parallel for the CompoundPriceSpecification node.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * This property links to all UnitPriceSpecification nodes that apply in - * parallel for the CompoundPriceSpecification node. - * - * @var UnitPriceSpecification [schema.org types: UnitPriceSpecification] + * @inheritdoc */ - public $priceComponent; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['priceComponent'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CompoundPriceSpecificationInterface.php b/src/models/jsonld/CompoundPriceSpecificationInterface.php new file mode 100644 index 000000000..353af24c7 --- /dev/null +++ b/src/models/jsonld/CompoundPriceSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ComputerLanguageInterface.php b/src/models/jsonld/ComputerLanguageInterface.php new file mode 100644 index 000000000..65f0a706b --- /dev/null +++ b/src/models/jsonld/ComputerLanguageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ComputerStoreInterface.php b/src/models/jsonld/ComputerStoreInterface.php new file mode 100644 index 000000000..f73f54eb1 --- /dev/null +++ b/src/models/jsonld/ComputerStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'event' => ['Event'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'event' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'event' => ['Event'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $event; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['event'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ConfirmActionInterface.php b/src/models/jsonld/ConfirmActionInterface.php new file mode 100644 index 000000000..59b5997ef --- /dev/null +++ b/src/models/jsonld/ConfirmActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ConsortiumInterface.php b/src/models/jsonld/ConsortiumInterface.php new file mode 100644 index 000000000..120193fb6 --- /dev/null +++ b/src/models/jsonld/ConsortiumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ConsumeActionInterface.php b/src/models/jsonld/ConsumeActionInterface.php new file mode 100644 index 000000000..a3d4c2565 --- /dev/null +++ b/src/models/jsonld/ConsumeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ContactPageInterface.php b/src/models/jsonld/ContactPageInterface.php new file mode 100644 index 000000000..f3acfc7a0 --- /dev/null +++ b/src/models/jsonld/ContactPageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availableLanguage' => ['Text', 'Language'], + 'contactOption' => ['ContactPointOption'], + 'contactType' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'email' => ['Text'], + 'faxNumber' => ['Text'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'productSupported' => ['Text', 'Product'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'areaServed', - 'availableLanguage', - 'contactOption', - 'contactType', - 'email', - 'faxNumber', - 'hoursAvailable', - 'productSupported', - 'telephone' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'availableLanguage' => ['Language', 'Text'], - 'contactOption' => ['ContactPointOption'], - 'contactType' => ['Text'], - 'email' => ['Text'], - 'faxNumber' => ['Text'], - 'hoursAvailable' => ['OpeningHoursSpecification'], - 'productSupported' => ['Product', 'Text'], - 'telephone' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. See also inLanguage', - 'contactOption' => 'An option available on this contact point (e.g. a toll-free number or support for hearing-impaired callers).', - 'contactType' => 'A person or organization can have different contact points, for different purposes. For example, a sales contact point, a PR contact point and so on. This property is used to specify the kind of contact point.', - 'email' => 'Email address.', - 'faxNumber' => 'The fax number.', - 'hoursAvailable' => 'The hours during which this service or contact is available.', - 'productSupported' => 'The product or service this support contact point is related to (such as product support for a particular product line). This can be a specific product or product line (e.g. "iPhone") or a general category of products or services (e.g. "smartphones").', - 'telephone' => 'The telephone number.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * A language someone may use with or at the item, service or place. Please - * use one of the language codes from the IETF BCP 47 standard. See also - * inLanguage - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $availableLanguage; - /** - * An option available on this contact point (e.g. a toll-free number or - * support for hearing-impaired callers). - * - * @var ContactPointOption [schema.org types: ContactPointOption] - */ - public $contactOption; - /** - * A person or organization can have different contact points, for different - * purposes. For example, a sales contact point, a PR contact point and so on. - * This property is used to specify the kind of contact point. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $contactType; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'contactOption' => 'An option available on this contact point (e.g. a toll-free number or support for hearing-impaired callers).', + 'contactType' => 'A person or organization can have different contact points, for different purposes. For example, a sales contact point, a PR contact point and so on. This property is used to specify the kind of contact point.', + 'description' => 'A description of the item.', + '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.', + 'email' => 'Email address.', + 'faxNumber' => 'The fax number.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productSupported' => 'The product or service this support contact point is related to (such as product support for a particular product line). This can be a specific product or product line (e.g. "iPhone") or a general category of products or services (e.g. "smartphones").', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The hours during which this service or contact is available. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $hoursAvailable; - /** - * The product or service this support contact point is related to (such as - * product support for a particular product line). This can be a specific - * product or product line (e.g. "iPhone") or a general category of products - * or services (e.g. "smartphones"). - * - * @var mixed|Product|string [schema.org types: Product, Text] - */ - public $productSupported; - /** - * The telephone number. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $telephone; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['areaServed', 'availableLanguage', 'contactOption', 'contactType', 'email', 'faxNumber', 'hoursAvailable', 'productSupported', 'telephone'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ContactPointInterface.php b/src/models/jsonld/ContactPointInterface.php new file mode 100644 index 000000000..9e3acabfb --- /dev/null +++ b/src/models/jsonld/ContactPointInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ContactPointOptionInterface.php b/src/models/jsonld/ContactPointOptionInterface.php new file mode 100644 index 000000000..7faea5911 --- /dev/null +++ b/src/models/jsonld/ContactPointOptionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ContagiousnessHealthAspectInterface.php b/src/models/jsonld/ContagiousnessHealthAspectInterface.php new file mode 100644 index 000000000..8c2901203 --- /dev/null +++ b/src/models/jsonld/ContagiousnessHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ContinentInterface.php b/src/models/jsonld/ContinentInterface.php new file mode 100644 index 000000000..470c84f3c --- /dev/null +++ b/src/models/jsonld/ContinentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ControlActionInterface.php b/src/models/jsonld/ControlActionInterface.php new file mode 100644 index 000000000..3e9d02d1b --- /dev/null +++ b/src/models/jsonld/ControlActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ConvenienceStoreInterface.php b/src/models/jsonld/ConvenienceStoreInterface.php new file mode 100644 index 000000000..d58ce639a --- /dev/null +++ b/src/models/jsonld/ConvenienceStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. The number of interactions for the CreativeWork using the - * WebSite or SoftwareApplication. The most specific child type of - * InteractionCounter should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ConversationInterface.php b/src/models/jsonld/ConversationInterface.php new file mode 100644 index 000000000..12176fe55 --- /dev/null +++ b/src/models/jsonld/ConversationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'foodEstablishment' => ['Place', 'FoodEstablishment'], + 'foodEvent' => ['FoodEvent'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipe' => ['Recipe'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'foodEstablishment', - 'foodEvent', - 'recipe' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'foodEstablishment' => ['FoodEstablishment', 'Place'], - 'foodEvent' => ['FoodEvent'], - 'recipe' => ['Recipe'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'foodEstablishment' => 'A sub property of location. The specific food establishment where the action occurred.', - 'foodEvent' => 'A sub property of location. The specific food event where the action occurred.', - 'recipe' => 'A sub property of instrument. The recipe/instructions used to perform the action.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'foodEstablishment' => 'A sub property of location. The specific food establishment where the action occurred.', + 'foodEvent' => 'A sub property of location. The specific food event where the action occurred.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipe' => 'A sub property of instrument. The recipe/instructions used to perform the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The specific food establishment where the - * action occurred. - * - * @var mixed|FoodEstablishment|Place [schema.org types: FoodEstablishment, Place] - */ - public $foodEstablishment; - /** - * A sub property of location. The specific food event where the action - * occurred. - * - * @var FoodEvent [schema.org types: FoodEvent] - */ - public $foodEvent; /** - * A sub property of instrument. The recipe/instructions used to perform the - * action. - * - * @var Recipe [schema.org types: Recipe] + * @inheritdoc */ - public $recipe; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['foodEstablishment', 'foodEvent', 'recipe'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CookActionInterface.php b/src/models/jsonld/CookActionInterface.php new file mode 100644 index 000000000..3ef74ad28 --- /dev/null +++ b/src/models/jsonld/CookActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tickerSymbol' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'tickerSymbol' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tickerSymbol' => 'The exchange traded instrument associated with a Corporation object. The tickerSymbol is expressed as an exchange and an instrument name separated by a space character. For the exchange component of the tickerSymbol attribute, we recommend using the controlled vocabulary of Market Identifier Codes (MIC) specified in ISO15022.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'tickerSymbol' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'tickerSymbol' => 'The exchange traded instrument associated with a Corporation object. The tickerSymbol is expressed as an exchange and an instrument name separated by a space character. For the exchange component of the tickerSymbol attribute, we recommend using the controlled vocabulary of Market Identifier Codes (MIC) specified in ISO15022.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The exchange traded instrument associated with a Corporation object. The - * tickerSymbol is expressed as an exchange and an instrument name separated - * by a space character. For the exchange component of the tickerSymbol - * attribute, we recommend using the controlled vocabulary of Market - * Identifier Codes (MIC) specified in ISO15022. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $tickerSymbol; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['tickerSymbol'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CorporationInterface.php b/src/models/jsonld/CorporationInterface.php new file mode 100644 index 000000000..9f8731c04 --- /dev/null +++ b/src/models/jsonld/CorporationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'downvoteCount' => ['Integer'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'parentItem' => ['Comment'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'upvoteCount' => ['Integer'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'downvoteCount', - 'parentItem', - 'upvoteCount' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'downvoteCount' => ['Integer'], - 'parentItem' => ['Question'], - 'upvoteCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'downvoteCount' => 'The number of downvotes this question, answer or comment has received from the community.', - 'parentItem' => 'The parent of a question, answer or item in general.', - 'upvoteCount' => 'The number of upvotes this question, answer or comment has received from the community.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'downvoteCount' => 'The number of downvotes this question, answer or comment has received from the community.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'parentItem' => 'The parent of a question, answer or item in general.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'upvoteCount' => 'The number of upvotes this question, answer or comment has received from the community.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of downvotes this question, answer or comment has received from - * the community. - * - * @var int [schema.org types: Integer] - */ - public $downvoteCount; - /** - * The parent of a question, answer or item in general. - * - * @var Question [schema.org types: Question] - */ - public $parentItem; /** - * The number of upvotes this question, answer or comment has received from - * the community. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $upvoteCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['downvoteCount', 'parentItem', 'upvoteCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CorrectionCommentInterface.php b/src/models/jsonld/CorrectionCommentInterface.php new file mode 100644 index 000000000..77e67ec98 --- /dev/null +++ b/src/models/jsonld/CorrectionCommentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CountryInterface.php b/src/models/jsonld/CountryInterface.php new file mode 100644 index 000000000..ac5826175 --- /dev/null +++ b/src/models/jsonld/CountryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'competencyRequired' => ['Text', 'DefinedTerm', 'URL'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'courseCode' => ['Text'], + 'coursePrerequisites' => ['Text', 'AlignmentObject', 'Course'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalCredentialAwarded' => ['URL', 'EducationalOccupationalCredential', 'Text'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasCourseInstance' => ['CourseInstance'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numberOfCredits' => ['Integer', 'StructuredValue'], + 'occupationalCredentialAwarded' => ['EducationalOccupationalCredential', 'Text', 'URL'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'courseCode', - 'coursePrerequisites', - 'educationalCredentialAwarded', - 'hasCourseInstance', - 'numberOfCredits', - 'occupationalCredentialAwarded' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'courseCode' => ['Text'], - 'coursePrerequisites' => ['AlignmentObject', 'Course', 'Text'], - 'educationalCredentialAwarded' => ['EducationalOccupationalCredential', 'Text', 'URL'], - 'hasCourseInstance' => ['CourseInstance'], - 'numberOfCredits' => ['Integer', 'StructuredValue'], - 'occupationalCredentialAwarded' => ['EducationalOccupationalCredential', 'Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'courseCode' => 'The identifier for the Course used by the course provider (e.g. CS101 or 6.001).', - 'coursePrerequisites' => 'Requirements for taking the Course. May be completion of another Course or a textual description like "permission of instructor". Requirements may be a pre-requisite competency, referenced using AlignmentObject.', - 'educationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other educational credential awarded as a consequence of successful completion of this course or program.', - 'hasCourseInstance' => 'An offering of the course at a specific time and place or through specific media or mode of study or to a specific section of students.', - 'numberOfCredits' => 'The number of credits or units awarded by a Course or required to complete an EducationalOccupationalProgram.', - 'occupationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other occupational credential awarded as a consequence of successful completion of this course or program.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The identifier for the Course used by the course provider (e.g. CS101 or - * 6.001). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $courseCode; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'competencyRequired' => 'Knowledge, skill, ability or personal attribute that must be demonstrated by a person or other entity in order to do something such as earn an Educational Occupational Credential or understand a LearningResource.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'courseCode' => 'The identifier for the [[Course]] used by the course [[provider]] (e.g. CS101 or 6.001).', + 'coursePrerequisites' => 'Requirements for taking the Course. May be completion of another [[Course]] or a textual description like "permission of instructor". Requirements may be a pre-requisite competency, referenced using [[AlignmentObject]].', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other educational credential awarded as a consequence of successful completion of this course or program.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasCourseInstance' => 'An offering of the course at a specific time and place or through specific media or mode of study or to a specific section of students.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numberOfCredits' => 'The number of credits or units awarded by a Course or required to complete an EducationalOccupationalProgram.', + 'occupationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other occupational credential awarded as a consequence of successful completion of this course or program.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Requirements for taking the Course. May be completion of another Course or - * a textual description like "permission of instructor". Requirements may be - * a pre-requisite competency, referenced using AlignmentObject. - * - * @var mixed|AlignmentObject|Course|string [schema.org types: AlignmentObject, Course, Text] - */ - public $coursePrerequisites; /** - * A description of the qualification, award, certificate, diploma or other - * educational credential awarded as a consequence of successful completion of - * this course or program. - * - * @var mixed|EducationalOccupationalCredential|string|string [schema.org types: EducationalOccupationalCredential, Text, URL] - */ - public $educationalCredentialAwarded; - /** - * An offering of the course at a specific time and place or through specific - * media or mode of study or to a specific section of students. - * - * @var CourseInstance [schema.org types: CourseInstance] - */ - public $hasCourseInstance; - /** - * The number of credits or units awarded by a Course or required to complete - * an EducationalOccupationalProgram. - * - * @var mixed|int|StructuredValue [schema.org types: Integer, StructuredValue] - */ - public $numberOfCredits; - /** - * A description of the qualification, award, certificate, diploma or other - * occupational credential awarded as a consequence of successful completion - * of this course or program. - * - * @var mixed|EducationalOccupationalCredential|string|string [schema.org types: EducationalOccupationalCredential, Text, URL] + * @inheritdoc */ - public $occupationalCredentialAwarded; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['courseCode', 'coursePrerequisites', 'educationalCredentialAwarded', 'hasCourseInstance', 'numberOfCredits', 'occupationalCredentialAwarded'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CourseInstance.php b/src/models/jsonld/CourseInstance.php index e65a61bdc..b9d2fbfee 100644 --- a/src/models/jsonld/CourseInstance.php +++ b/src/models/jsonld/CourseInstance.php @@ -1,29 +1,29 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'courseMode' => ['URL', 'Text'], + 'courseWorkload' => ['Text'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instructor' => ['Person'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'courseMode', - 'courseWorkload', - 'instructor' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'courseMode' => ['Text', 'URL'], - 'courseWorkload' => ['Text'], - 'instructor' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'courseMode' => 'The medium or means of delivery of the course instance or the mode of study, either as a text label (e.g. "online", "onsite" or "blended"; "synchronous" or "asynchronous"; "full-time" or "part-time") or as a URL reference to a term from a controlled vocabulary (e.g. https://ceds.ed.gov/element/001311#Asynchronous ).', - 'courseWorkload' => 'The amount of work expected of students taking the course, often provided as a figure per week or per month, and may be broken down by type. For example, "2 hours of lectures, 1 hour of lab work and 3 hours of independent study per week".', - 'instructor' => 'A person assigned to instruct or provide instructional assistance for the CourseInstance.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'courseMode' => 'The medium or means of delivery of the course instance or the mode of study, either as a text label (e.g. "online", "onsite" or "blended"; "synchronous" or "asynchronous"; "full-time" or "part-time") or as a URL reference to a term from a controlled vocabulary (e.g. https://ceds.ed.gov/element/001311#Asynchronous ).', + 'courseWorkload' => 'The amount of work expected of students taking the course, often provided as a figure per week or per month, and may be broken down by type. For example, "2 hours of lectures, 1 hour of lab work and 3 hours of independent study per week".', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instructor' => 'A person assigned to instruct or provide instructional assistance for the [[CourseInstance]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The medium or means of delivery of the course instance or the mode of - * study, either as a text label (e.g. "online", "onsite" or "blended"; - * "synchronous" or "asynchronous"; "full-time" or "part-time") or as a URL - * reference to a term from a controlled vocabulary (e.g. - * https://ceds.ed.gov/element/001311#Asynchronous ). - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $courseMode; - /** - * The amount of work expected of students taking the course, often provided - * as a figure per week or per month, and may be broken down by type. For - * example, "2 hours of lectures, 1 hour of lab work and 3 hours of - * independent study per week". - * - * @var string [schema.org types: Text] - */ - public $courseWorkload; /** - * A person assigned to instruct or provide instructional assistance for the - * CourseInstance. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $instructor; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['courseMode', 'courseWorkload', 'instructor'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CourseInstanceInterface.php b/src/models/jsonld/CourseInstanceInterface.php new file mode 100644 index 000000000..de44df892 --- /dev/null +++ b/src/models/jsonld/CourseInstanceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CourthouseInterface.php b/src/models/jsonld/CourthouseInterface.php new file mode 100644 index 000000000..ce731573c --- /dev/null +++ b/src/models/jsonld/CourthouseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'artEdition' => ['Integer', 'Text'], + 'artMedium' => ['URL', 'Text'], + 'artform' => ['Text', 'URL'], + 'artist' => ['Person'], + 'artworkSurface' => ['URL', 'Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'colorist' => ['Person'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'inker' => ['Person'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'letterer' => ['Person'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'penciler' => ['Person'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'surface' => ['URL', 'Text'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'artEdition', - 'artMedium', - 'artform', - 'artist', - 'artworkSurface', - 'colorist', - 'depth', - 'height', - 'inker', - 'letterer', - 'penciler', - 'width' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'artEdition' => ['Integer', 'Text'], - 'artMedium' => ['Text', 'URL'], - 'artform' => ['Text', 'URL'], - 'artist' => ['Person'], - 'artworkSurface' => ['Text', 'URL'], - 'colorist' => ['Person'], - 'depth' => ['Distance', 'QuantitativeValue'], - 'height' => ['Distance', 'QuantitativeValue'], - 'inker' => ['Person'], - 'letterer' => ['Person'], - 'penciler' => ['Person'], - 'width' => ['Distance', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'artEdition' => 'The number of copies when multiple copies of a piece of artwork are produced - e.g. for a limited edition of 20 prints, \'artEdition\' refers to the total number of copies (in this example "20").', - 'artMedium' => 'The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.)', - 'artform' => 'e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, etc.', - 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', - 'artworkSurface' => 'The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, etc. Supersedes surface.', - 'colorist' => 'The individual who adds color to inked drawings.', - 'depth' => 'The depth of the item.', - 'height' => 'The height of the item.', - 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', - 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', - 'penciler' => 'The individual who draws the primary narrative artwork.', - 'width' => 'The width of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of copies when multiple copies of a piece of artwork are - * produced - e.g. for a limited edition of 20 prints, 'artEdition' refers to - * the total number of copies (in this example "20"). - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $artEdition; /** - * The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, - * Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, - * Pencil, Mixed Media, etc.) - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $artMedium; - /** - * e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, - * etc. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $artform; - /** - * The primary artist for a work in a medium other than pencils or digital - * line art--for example, if the primary artwork is done in watercolors or - * digital paints. - * - * @var Person [schema.org types: Person] - */ - public $artist; - /** - * The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, - * etc. Supersedes surface. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $artworkSurface; - /** - * The individual who adds color to inked drawings. - * - * @var Person [schema.org types: Person] - */ - public $colorist; - /** - * The depth of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] + * @inheritdoc */ - public $depth; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'artEdition' => 'The number of copies when multiple copies of a piece of artwork are produced - e.g. for a limited edition of 20 prints, \'artEdition\' refers to the total number of copies (in this example "20").', + 'artMedium' => 'The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.)', + 'artform' => 'e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, etc.', + 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', + 'artworkSurface' => 'The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'colorist' => 'The individual who adds color to inked drawings.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'penciler' => 'The individual who draws the primary narrative artwork.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'surface' => 'A material used as a surface in some artwork, e.g. Canvas, Paper, Wood, Board, etc.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The height of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] - */ - public $height; - /** - * The individual who traces over the pencil drawings in ink after pencils are - * complete. - * - * @var Person [schema.org types: Person] - */ - public $inker; - /** - * The individual who adds lettering, including speech balloons and sound - * effects, to artwork. - * - * @var Person [schema.org types: Person] - */ - public $letterer; - /** - * The individual who draws the primary narrative artwork. - * - * @var Person [schema.org types: Person] - */ - public $penciler; /** - * The width of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] + * @inheritdoc */ - public $width; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['artEdition', 'artMedium', 'artform', 'artist', 'artworkSurface', 'colorist', 'depth', 'height', 'inker', 'letterer', 'penciler', 'width'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CoverArtInterface.php b/src/models/jsonld/CoverArtInterface.php new file mode 100644 index 000000000..62e534055 --- /dev/null +++ b/src/models/jsonld/CoverArtInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availableService' => ['MedicalTest', 'MedicalProcedure', 'MedicalTherapy'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthPlanNetworkId' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAcceptingNewPatients' => ['Boolean'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'medicalSpecialty' => ['MedicalSpecialty'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'availableService', - 'medicalSpecialty' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'availableService' => ['MedicalProcedure', 'MedicalTest', 'MedicalTherapy'], - 'medicalSpecialty' => ['MedicalSpecialty'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availableService' => 'A medical service available from this provider.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'medicalSpecialty' => 'A medical specialty of the provider.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'availableService' => 'A medical service available from this provider.', - 'medicalSpecialty' => 'A medical specialty of the provider.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical service available from this provider. - * - * @var mixed|MedicalProcedure|MedicalTest|MedicalTherapy [schema.org types: MedicalProcedure, MedicalTest, MedicalTherapy] - */ - public $availableService; - /** - * A medical specialty of the provider. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] + * @inheritdoc */ - public $medicalSpecialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['availableService', 'medicalSpecialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CovidTestingFacilityInterface.php b/src/models/jsonld/CovidTestingFacilityInterface.php new file mode 100644 index 000000000..d80334084 --- /dev/null +++ b/src/models/jsonld/CovidTestingFacilityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CreateActionInterface.php b/src/models/jsonld/CreateActionInterface.php new file mode 100644 index 000000000..c9c3f7c5f --- /dev/null +++ b/src/models/jsonld/CreateActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CreativeWorkInterface.php b/src/models/jsonld/CreativeWorkInterface.php new file mode 100644 index 000000000..3bb4ccf0e --- /dev/null +++ b/src/models/jsonld/CreativeWorkInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'episode' => ['Episode'], + 'episodes' => ['Episode'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numberOfEpisodes' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'seasonNumber' => ['Text', 'Integer'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'director', - 'endDate', - 'episode', - 'numberOfEpisodes', - 'partOfSeries', - 'productionCompany', - 'seasonNumber', - 'startDate', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'director' => ['Person'], - 'endDate' => ['Date', 'DateTime'], - 'episode' => ['Episode'], - 'numberOfEpisodes' => ['Integer'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'productionCompany' => ['Organization'], - 'seasonNumber' => ['Integer', 'Text'], - 'startDate' => ['Date', 'DateTime'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - '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. Supersedes directors.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'episode' => 'An episode of a tv, radio or game media within a series or season. Supersedes episodes.', - 'numberOfEpisodes' => 'The number of episodes in this season or series.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'seasonNumber' => 'Position of the season within an ordered group of seasons.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * An episode of a tv, radio or game media within a series or season. - * Supersedes episodes. - * - * @var Episode [schema.org types: Episode] - */ - public $episode; - /** - * The number of episodes in this season or series. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $numberOfEpisodes; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'episode' => 'An episode of a tv, radio or game media within a series or season.', + 'episodes' => 'An episode of a TV/radio series or season.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numberOfEpisodes' => 'The number of episodes in this season or series.', + '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. ', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'seasonNumber' => 'Position of the season within an ordered group of seasons.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * Position of the season within an ordered group of seasons. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $seasonNumber; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'director', 'endDate', 'episode', 'numberOfEpisodes', 'partOfSeries', 'productionCompany', 'seasonNumber', 'startDate', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CreativeWorkSeasonInterface.php b/src/models/jsonld/CreativeWorkSeasonInterface.php new file mode 100644 index 000000000..7d08f482b --- /dev/null +++ b/src/models/jsonld/CreativeWorkSeasonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'endDate', - 'issn', - 'startDate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'endDate' => ['Date', 'DateTime'], - 'issn' => ['Text'], - 'startDate' => ['Date', 'DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The International Standard Serial Number (ISSN) that identifies this serial - * publication. You can repeat this property to identify different formats of, - * or the linking ISSN (ISSN-L) for, this serial publication. - * - * @var string [schema.org types: Text] - */ - public $issn; /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $startDate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['endDate', 'issn', 'startDate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CreativeWorkSeriesInterface.php b/src/models/jsonld/CreativeWorkSeriesInterface.php new file mode 100644 index 000000000..74b95f0e5 --- /dev/null +++ b/src/models/jsonld/CreativeWorkSeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'cashBack' => ['Number', 'Boolean'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'contactlessPayment' => ['Boolean'], + 'currency' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'floorLimit' => ['MonetaryAmount'], + 'gracePeriod' => ['Duration'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'loanRepaymentForm' => ['RepaymentSpecification'], + 'loanTerm' => ['QuantitativeValue'], + 'loanType' => ['URL', 'Text'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'monthlyMinimumRepaymentAmount' => ['MonetaryAmount', 'Number'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'recourseLoan' => ['Boolean'], + 'renegotiableLoan' => ['Boolean'], + 'requiredCollateral' => ['Text', 'Thing'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static public $googleRecommendedSchema = []; - - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'monthlyMinimumRepaymentAmount' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'cashBack' => 'A cardholder benefit that pays the cardholder a small percentage of their net expenditures.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'contactlessPayment' => 'A secure method for consumers to purchase products or services via debit, credit or smartcards by using RFID or NFC technology.', + 'currency' => 'The currency in which the monetary amount is expressed. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'floorLimit' => 'A floor limit is the amount of money above which credit card transactions must be authorized.', + 'gracePeriod' => 'The period of time after any due date that the borrower has to fulfil its obligations before a default (failure to pay) is deemed to have occurred.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'loanRepaymentForm' => 'A form of paying back money previously borrowed from a lender. Repayment usually takes the form of periodic payments that normally include part principal plus interest in each payment.', + 'loanTerm' => 'The duration of the loan or credit agreement.', + 'loanType' => 'The type of a loan or credit.', + 'logo' => 'An associated logo.', + '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.', + 'monthlyMinimumRepaymentAmount' => 'The minimum payment is the lowest amount of money that one is required to pay on a credit card statement each month.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'recourseLoan' => 'The only way you get the money back in the event of default is the security. Recourse is where you still have the opportunity to go back to the borrower for the rest of the money.', + 'renegotiableLoan' => 'Whether the terms for payment of interest can be renegotiated during the life of the loan.', + 'requiredCollateral' => 'Assets required to secure loan or credit repayments. It may take form of third party pledge, goods, financial instruments (cash, securities, etc.)', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'monthlyMinimumRepaymentAmount' => ['MonetaryAmount', 'Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'monthlyMinimumRepaymentAmount' => 'The minimum payment is the lowest amount of money that one is required to pay on a credit card statement each month.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The minimum payment is the lowest amount of money that one is required to - * pay on a credit card statement each month. - * - * @var mixed|MonetaryAmount|float [schema.org types: MonetaryAmount, Number] + * @inheritdoc */ - public $monthlyMinimumRepaymentAmount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['monthlyMinimumRepaymentAmount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CreditCardInterface.php b/src/models/jsonld/CreditCardInterface.php new file mode 100644 index 000000000..549914916 --- /dev/null +++ b/src/models/jsonld/CreditCardInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CrematoriumInterface.php b/src/models/jsonld/CrematoriumInterface.php new file mode 100644 index 000000000..9da36ea96 --- /dev/null +++ b/src/models/jsonld/CrematoriumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedClaimReview' => ['Review'], + 'associatedMedia' => ['MediaObject'], + 'associatedMediaReview' => ['Review'], + 'associatedReview' => ['Review'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'itemReviewed' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'negativeNotes' => ['ListItem', 'Text', 'WebContent', 'ItemList'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'positiveNotes' => ['WebContent', 'Text', 'ListItem', 'ItemList'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewAspect' => ['Text'], + 'reviewBody' => ['Text'], + 'reviewRating' => ['Rating'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemReviewed', - 'reviewAspect', - 'reviewBody', - 'reviewRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemReviewed' => ['Thing'], - 'reviewAspect' => ['Text'], - 'reviewBody' => ['Text'], - 'reviewRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'itemReviewed' => 'The item that is being reviewed/rated.', - 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', - 'reviewBody' => 'The actual body of the review.', - 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The reviewRating applies to rating given by the review. The aggregateRating property applies to the review itself, as a creative work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedClaimReview' => 'An associated [[ClaimReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'associatedMediaReview' => 'An associated [[MediaReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedReview' => 'An associated [[Review]].', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'negativeNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), negative considerations - either as unstructured text, or a list.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'positiveNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), positive considerations - either as unstructured text, or a list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewBody' => 'The actual body of the review.', + 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating``` applies to rating given by the review. The [[aggregateRating]] property applies to the review itself, as a creative work.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The item that is being reviewed/rated. - * - * @var Thing [schema.org types: Thing] - */ - public $itemReviewed; - /** - * This Review or Rating is relevant to this part or facet of the - * itemReviewed. - * - * @var string [schema.org types: Text] - */ - public $reviewAspect; - /** - * The actual body of the review. - * - * @var string [schema.org types: Text] - */ - public $reviewBody; /** - * The rating given in this review. Note that reviews can themselves be rated. - * The reviewRating applies to rating given by the review. The aggregateRating - * property applies to the review itself, as a creative work. - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $reviewRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemReviewed', 'reviewAspect', 'reviewBody', 'reviewRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CriticReviewInterface.php b/src/models/jsonld/CriticReviewInterface.php new file mode 100644 index 000000000..38add1073 --- /dev/null +++ b/src/models/jsonld/CriticReviewInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CrossSectionalInterface.php b/src/models/jsonld/CrossSectionalInterface.php new file mode 100644 index 000000000..65896f19d --- /dev/null +++ b/src/models/jsonld/CrossSectionalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CssSelectorTypeInterface.php b/src/models/jsonld/CssSelectorTypeInterface.php new file mode 100644 index 000000000..acc834a47 --- /dev/null +++ b/src/models/jsonld/CssSelectorTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'annualPercentageRate', - 'feesAndCommissionsSpecification', - 'interestRate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'annualPercentageRate' => ['Number', 'QuantitativeValue'], - 'feesAndCommissionsSpecification' => ['Text', 'URL'], - 'interestRate' => ['Number', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', - 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', - 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The annual rate that is charged for borrowing (or made by investing), - * expressed as a single percentage number that represents the actual yearly - * cost of funds over the term of a loan. This includes any fees or additional - * costs associated with the transaction. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $annualPercentageRate; - /** - * Description of fees, commissions, and other terms applied either to a class - * of financial product, or by a financial service organization. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $feesAndCommissionsSpecification; /** - * The interest rate, charged or paid, applicable to the financial product. - * Note: This is different from the calculated annualPercentageRate. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] + * @inheritdoc */ - public $interestRate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['annualPercentageRate', 'feesAndCommissionsSpecification', 'interestRate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/CurrencyConversionServiceInterface.php b/src/models/jsonld/CurrencyConversionServiceInterface.php new file mode 100644 index 000000000..004753295 --- /dev/null +++ b/src/models/jsonld/CurrencyConversionServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'diagnosis' => ['MedicalCondition'], + 'disambiguatingDescription' => ['Text'], + 'distinguishingSign' => ['MedicalSignOrSymptom'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'diagnosis', - 'distinguishingSign' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'diagnosis' => ['MedicalCondition'], - 'distinguishingSign' => ['MedicalSignOrSymptom'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + 'diagnosis' => 'One or more alternative conditions considered in the differential diagnosis process as output of a diagnosis process.', + '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.', + 'distinguishingSign' => 'One of a set of signs and symptoms that can be used to distinguish this diagnosis from others in the differential diagnosis.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'diagnosis' => 'One or more alternative conditions considered in the differential diagnosis process as output of a diagnosis process.', - 'distinguishingSign' => 'One of a set of signs and symptoms that can be used to distinguish this diagnosis from others in the differential diagnosis.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * One or more alternative conditions considered in the differential diagnosis - * process as output of a diagnosis process. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $diagnosis; - /** - * One of a set of signs and symptoms that can be used to distinguish this - * diagnosis from others in the differential diagnosis. - * - * @var MedicalSignOrSymptom [schema.org types: MedicalSignOrSymptom] + * @inheritdoc */ - public $distinguishingSign; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['diagnosis', 'distinguishingSign'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DDxElementInterface.php b/src/models/jsonld/DDxElementInterface.php new file mode 100644 index 000000000..4b45c5cf9 --- /dev/null +++ b/src/models/jsonld/DDxElementInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DJMixAlbumInterface.php b/src/models/jsonld/DJMixAlbumInterface.php new file mode 100644 index 000000000..bb7476dee --- /dev/null +++ b/src/models/jsonld/DJMixAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DVDFormatInterface.php b/src/models/jsonld/DVDFormatInterface.php new file mode 100644 index 000000000..d01eef9f2 --- /dev/null +++ b/src/models/jsonld/DVDFormatInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DamagedConditionInterface.php b/src/models/jsonld/DamagedConditionInterface.php new file mode 100644 index 000000000..87c9a486f --- /dev/null +++ b/src/models/jsonld/DamagedConditionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DanceEventInterface.php b/src/models/jsonld/DanceEventInterface.php new file mode 100644 index 000000000..fd90a14ae --- /dev/null +++ b/src/models/jsonld/DanceEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DanceGroupInterface.php b/src/models/jsonld/DanceGroupInterface.php new file mode 100644 index 000000000..c10b91d9b --- /dev/null +++ b/src/models/jsonld/DanceGroupInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DangerousGoodConsiderationInterface.php b/src/models/jsonld/DangerousGoodConsiderationInterface.php new file mode 100644 index 000000000..a2e1ac149 --- /dev/null +++ b/src/models/jsonld/DangerousGoodConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dataset' => ['Dataset'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'measurementTechnique' => ['Text', 'URL'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dataset', - 'measurementTechnique' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'dataset' => ['Dataset'], - 'measurementTechnique' => ['Text', 'URL'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dataset' => 'A dataset contained in this catalog.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'measurementTechnique' => 'A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]), corresponding to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]]). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if [[variableMeasured]] is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the [[variableMeasured]] is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several [[variableMeasured]] properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]]. ', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dataset' => 'A dataset contained in this catalog. Inverse property: includedInDataCatalog.', - 'measurementTechnique' => 'A technique or technology used in a Dataset (or DataDownload, DataCatalog), corresponding to the method used for measuring the corresponding variable(s) (described using variableMeasured). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if variableMeasured is: molecule concentration, measurementTechnique could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the variableMeasured is "depression rating", the measurementTechnique could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several variableMeasured properties recorded for some given data object, use a PropertyValue for each variableMeasured and attach the corresponding measurementTechnique.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A dataset contained in this catalog. Inverse property: - * includedInDataCatalog. - * - * @var Dataset [schema.org types: Dataset] - */ - public $dataset; - /** - * A technique or technology used in a Dataset (or DataDownload, DataCatalog), - * corresponding to the method used for measuring the corresponding - * variable(s) (described using variableMeasured). This is oriented towards - * scientific and scholarly dataset publication but may have broader - * applicability; it is not intended as a full representation of measurement, - * but rather as a high level summary for dataset discovery. For example, if - * variableMeasured is: molecule concentration, measurementTechnique could be: - * "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or - * "immunofluorescence". If the variableMeasured is "depression rating", the - * measurementTechnique could be "Zung Scale" or "HAM-D" or "Beck Depression - * Inventory". If there are several variableMeasured properties recorded for - * some given data object, use a PropertyValue for each variableMeasured and - * attach the corresponding measurementTechnique. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $measurementTechnique; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dataset', 'measurementTechnique'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DataCatalogInterface.php b/src/models/jsonld/DataCatalogInterface.php new file mode 100644 index 000000000..ebcbe93c7 --- /dev/null +++ b/src/models/jsonld/DataCatalogInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'measurementTechnique' => ['Text', 'URL'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'measurementTechnique' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'measurementTechnique' => 'A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]), corresponding to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]]). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if [[variableMeasured]] is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the [[variableMeasured]] is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several [[variableMeasured]] properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]]. ', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'measurementTechnique' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'measurementTechnique' => 'A technique or technology used in a Dataset (or DataDownload, DataCatalog), corresponding to the method used for measuring the corresponding variable(s) (described using variableMeasured). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if variableMeasured is: molecule concentration, measurementTechnique could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the variableMeasured is "depression rating", the measurementTechnique could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several variableMeasured properties recorded for some given data object, use a PropertyValue for each variableMeasured and attach the corresponding measurementTechnique.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A technique or technology used in a Dataset (or DataDownload, DataCatalog), - * corresponding to the method used for measuring the corresponding - * variable(s) (described using variableMeasured). This is oriented towards - * scientific and scholarly dataset publication but may have broader - * applicability; it is not intended as a full representation of measurement, - * but rather as a high level summary for dataset discovery. For example, if - * variableMeasured is: molecule concentration, measurementTechnique could be: - * "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or - * "immunofluorescence". If the variableMeasured is "depression rating", the - * measurementTechnique could be "Zung Scale" or "HAM-D" or "Beck Depression - * Inventory". If there are several variableMeasured properties recorded for - * some given data object, use a PropertyValue for each variableMeasured and - * attach the corresponding measurementTechnique. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $measurementTechnique; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['measurementTechnique'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DataDownloadInterface.php b/src/models/jsonld/DataDownloadInterface.php new file mode 100644 index 000000000..7815b9050 --- /dev/null +++ b/src/models/jsonld/DataDownloadInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'catalog' => ['DataCatalog'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dataFeedElement' => ['Thing', 'DataFeedItem', 'Text'], + 'datasetTimeInterval' => ['DateTime'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'distribution' => ['DataDownload'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'includedDataCatalog' => ['DataCatalog'], + 'includedInDataCatalog' => ['DataCatalog'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'measurementTechnique' => ['Text', 'URL'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'variableMeasured' => ['PropertyValue', 'Text'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'dataFeedElement' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'catalog' => 'A data catalog which contains this dataset.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dataFeedElement' => 'An item within in a data feed. Data feeds may have many elements.', + 'datasetTimeInterval' => 'The range of temporal applicability of a dataset, e.g. for a 2011 census dataset, the year 2011 (in ISO 8601 time interval format).', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'distribution' => 'A downloadable form of this dataset, at a specific location, in a specific format.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'includedDataCatalog' => 'A data catalog which contains this dataset (this property was previously \'catalog\', preferred name is now \'includedInDataCatalog\').', + 'includedInDataCatalog' => 'A data catalog which contains this dataset.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'measurementTechnique' => 'A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]), corresponding to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]]). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if [[variableMeasured]] is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the [[variableMeasured]] is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several [[variableMeasured]] properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]]. ', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'variableMeasured' => 'The variableMeasured property can indicate (repeated as necessary) the variables that are measured in some dataset, either described as text or as pairs of identifier and description using PropertyValue.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dataFeedElement' => ['DataFeedItem', 'Text', 'Thing'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dataFeedElement' => 'An item within in a data feed. Data feeds may have many elements.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An item within in a data feed. Data feeds may have many elements. - * - * @var mixed|DataFeedItem|string|Thing [schema.org types: DataFeedItem, Text, Thing] + * @inheritdoc */ - public $dataFeedElement; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dataFeedElement'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DataFeedInterface.php b/src/models/jsonld/DataFeedInterface.php new file mode 100644 index 000000000..740923e4b --- /dev/null +++ b/src/models/jsonld/DataFeedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateDeleted' => ['DateTime', 'Date'], + 'dateModified' => ['DateTime', 'Date'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'item' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dateCreated', - 'dateDeleted', - 'dateModified', - 'item' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dateCreated' => ['Date', 'DateTime'], - 'dateDeleted' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'item' => ['Thing'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateDeleted' => 'The datetime the item was removed from the DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateDeleted' => 'The datetime the item was removed from the DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The datetime the item was removed from the DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateDeleted; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; /** - * An entity represented by an entry in a list or data feed (e.g. an 'artist' - * in a list of 'artists')’. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $item; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dateCreated', 'dateDeleted', 'dateModified', 'item'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DataFeedItemInterface.php b/src/models/jsonld/DataFeedItemInterface.php new file mode 100644 index 000000000..40287d4c3 --- /dev/null +++ b/src/models/jsonld/DataFeedItemInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DataTypeInterface.php b/src/models/jsonld/DataTypeInterface.php new file mode 100644 index 000000000..3ab34b40d --- /dev/null +++ b/src/models/jsonld/DataTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'catalog' => ['DataCatalog'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'datasetTimeInterval' => ['DateTime'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'distribution' => ['DataDownload'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'includedDataCatalog' => ['DataCatalog'], + 'includedInDataCatalog' => ['DataCatalog'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'measurementTechnique' => ['Text', 'URL'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'variableMeasured' => ['PropertyValue', 'Text'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'distribution', - 'includedInDataCatalog', - 'issn', - 'measurementTechnique', - 'variableMeasured' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'distribution' => ['DataDownload'], - 'includedInDataCatalog' => ['DataCatalog'], - 'issn' => ['Text'], - 'measurementTechnique' => ['Text', 'URL'], - 'variableMeasured' => ['PropertyValue', 'Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'distribution' => 'A downloadable form of this dataset, at a specific location, in a specific format.', - 'includedInDataCatalog' => 'A data catalog which contains this dataset. Supersedes catalog, includedDataCatalog. Inverse property: dataset.', - 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', - 'measurementTechnique' => 'A technique or technology used in a Dataset (or DataDownload, DataCatalog), corresponding to the method used for measuring the corresponding variable(s) (described using variableMeasured). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if variableMeasured is: molecule concentration, measurementTechnique could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the variableMeasured is "depression rating", the measurementTechnique could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several variableMeasured properties recorded for some given data object, use a PropertyValue for each variableMeasured and attach the corresponding measurementTechnique.', - 'variableMeasured' => 'The variableMeasured property can indicate (repeated as necessary) the variables that are measured in some dataset, either described as text or as pairs of identifier and description using PropertyValue.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'catalog' => 'A data catalog which contains this dataset.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'datasetTimeInterval' => 'The range of temporal applicability of a dataset, e.g. for a 2011 census dataset, the year 2011 (in ISO 8601 time interval format).', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'distribution' => 'A downloadable form of this dataset, at a specific location, in a specific format.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'includedDataCatalog' => 'A data catalog which contains this dataset (this property was previously \'catalog\', preferred name is now \'includedInDataCatalog\').', + 'includedInDataCatalog' => 'A data catalog which contains this dataset.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'measurementTechnique' => 'A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]), corresponding to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]]). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if [[variableMeasured]] is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the [[variableMeasured]] is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several [[variableMeasured]] properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]]. ', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'variableMeasured' => 'The variableMeasured property can indicate (repeated as necessary) the variables that are measured in some dataset, either described as text or as pairs of identifier and description using PropertyValue.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A downloadable form of this dataset, at a specific location, in a specific - * format. - * - * @var DataDownload [schema.org types: DataDownload] - */ - public $distribution; - /** - * A data catalog which contains this dataset. Supersedes catalog, - * includedDataCatalog. Inverse property: dataset. - * - * @var DataCatalog [schema.org types: DataCatalog] - */ - public $includedInDataCatalog; - /** - * The International Standard Serial Number (ISSN) that identifies this serial - * publication. You can repeat this property to identify different formats of, - * or the linking ISSN (ISSN-L) for, this serial publication. - * - * @var string [schema.org types: Text] - */ - public $issn; - /** - * A technique or technology used in a Dataset (or DataDownload, DataCatalog), - * corresponding to the method used for measuring the corresponding - * variable(s) (described using variableMeasured). This is oriented towards - * scientific and scholarly dataset publication but may have broader - * applicability; it is not intended as a full representation of measurement, - * but rather as a high level summary for dataset discovery. For example, if - * variableMeasured is: molecule concentration, measurementTechnique could be: - * "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or - * "immunofluorescence". If the variableMeasured is "depression rating", the - * measurementTechnique could be "Zung Scale" or "HAM-D" or "Beck Depression - * Inventory". If there are several variableMeasured properties recorded for - * some given data object, use a PropertyValue for each variableMeasured and - * attach the corresponding measurementTechnique. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $measurementTechnique; - /** - * The variableMeasured property can indicate (repeated as necessary) the - * variables that are measured in some dataset, either described as text or as - * pairs of identifier and description using PropertyValue. - * - * @var mixed|PropertyValue|string [schema.org types: PropertyValue, Text] + * @inheritdoc */ - public $variableMeasured; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['distribution', 'includedInDataCatalog', 'issn', 'measurementTechnique', 'variableMeasured'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DatasetInterface.php b/src/models/jsonld/DatasetInterface.php new file mode 100644 index 000000000..b9e564e9f --- /dev/null +++ b/src/models/jsonld/DatasetInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DateInterface.php b/src/models/jsonld/DateInterface.php new file mode 100644 index 000000000..6048aeeb5 --- /dev/null +++ b/src/models/jsonld/DateInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DateTimeInterface.php b/src/models/jsonld/DateTimeInterface.php new file mode 100644 index 000000000..627518d2d --- /dev/null +++ b/src/models/jsonld/DateTimeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'currency' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endDate' => ['Date', 'DateTime'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'currency' => 'The currency in which the monetary amount is expressed. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'description' => 'A description of the item.', + '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.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DatedMoneySpecificationInterface.php b/src/models/jsonld/DatedMoneySpecificationInterface.php new file mode 100644 index 000000000..abdcd2e6e --- /dev/null +++ b/src/models/jsonld/DatedMoneySpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DayOfWeekInterface.php b/src/models/jsonld/DayOfWeekInterface.php new file mode 100644 index 000000000..c8cfb8dea --- /dev/null +++ b/src/models/jsonld/DayOfWeekInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DaySpaInterface.php b/src/models/jsonld/DaySpaInterface.php new file mode 100644 index 000000000..432f2fa6e --- /dev/null +++ b/src/models/jsonld/DaySpaInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DeactivateActionInterface.php b/src/models/jsonld/DeactivateActionInterface.php new file mode 100644 index 000000000..6cc5a3bbe --- /dev/null +++ b/src/models/jsonld/DeactivateActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DecontextualizedContentInterface.php b/src/models/jsonld/DecontextualizedContentInterface.php new file mode 100644 index 000000000..a3c20c3c8 --- /dev/null +++ b/src/models/jsonld/DecontextualizedContentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DefenceEstablishmentInterface.php b/src/models/jsonld/DefenceEstablishmentInterface.php new file mode 100644 index 000000000..9e7d437ae --- /dev/null +++ b/src/models/jsonld/DefenceEstablishmentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'addressCountry' => ['Country', 'Text'], + 'addressRegion' => ['Text'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'postalCode' => ['Text'], + 'postalCodePrefix' => ['Text'], + 'postalCodeRange' => ['PostalCodeRangeSpecification'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + '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).', + 'addressRegion' => 'The region in which the locality is, and which is in the country. For example, California or another appropriate first-level [Administrative division](https://en.wikipedia.org/wiki/List_of_administrative_divisions_by_country) ', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'postalCode' => 'The postal code. For example, 94043.', + 'postalCodePrefix' => 'A defined range of postal codes indicated by a common textual prefix. Used for non-numeric systems such as UK.', + 'postalCodeRange' => 'A defined range of postal codes.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DefinedRegionInterface.php b/src/models/jsonld/DefinedRegionInterface.php new file mode 100644 index 000000000..d818a775c --- /dev/null +++ b/src/models/jsonld/DefinedRegionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inDefinedTermSet' => ['URL', 'DefinedTermSet'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termCode' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'inDefinedTermSet', - 'termCode' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'inDefinedTermSet' => ['DefinedTermSet', 'URL'], - 'termCode' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inDefinedTermSet' => 'A [[DefinedTermSet]] that contains this term.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termCode' => 'A code that identifies this [[DefinedTerm]] within a [[DefinedTermSet]]', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'inDefinedTermSet' => 'A DefinedTermSet that contains this term.', - 'termCode' => 'A code that identifies this DefinedTerm within a DefinedTermSet' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A DefinedTermSet that contains this term. - * - * @var mixed|DefinedTermSet|string [schema.org types: DefinedTermSet, URL] - */ - public $inDefinedTermSet; - /** - * A code that identifies this DefinedTerm within a DefinedTermSet - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $termCode; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['inDefinedTermSet', 'termCode'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DefinedTermInterface.php b/src/models/jsonld/DefinedTermInterface.php new file mode 100644 index 000000000..c7328ac76 --- /dev/null +++ b/src/models/jsonld/DefinedTermInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasDefinedTerm' => ['DefinedTerm'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'hasDefinedTerm' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasDefinedTerm' => 'A Defined Term contained in this term set.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasDefinedTerm' => ['DefinedTerm'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasDefinedTerm' => 'A Defined Term contained in this term set.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A Defined Term contained in this term set. - * - * @var DefinedTerm [schema.org types: DefinedTerm] + * @inheritdoc */ - public $hasDefinedTerm; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasDefinedTerm'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DefinedTermSetInterface.php b/src/models/jsonld/DefinedTermSetInterface.php new file mode 100644 index 000000000..dfd3502ad --- /dev/null +++ b/src/models/jsonld/DefinedTermSetInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DefinitiveLegalValueInterface.php b/src/models/jsonld/DefinitiveLegalValueInterface.php new file mode 100644 index 000000000..7d5ea9e2e --- /dev/null +++ b/src/models/jsonld/DefinitiveLegalValueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'collection' => ['Thing'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'targetCollection' => ['Thing'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'targetCollection' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'collection' => 'A sub property of object. The collection target of the action.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'targetCollection' => 'A sub property of object. The collection target of the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'targetCollection' => ['Thing'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'targetCollection' => 'A sub property of object. The collection target of the action. Supersedes collection.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of object. The collection target of the action. Supersedes - * collection. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $targetCollection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['targetCollection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DeleteActionInterface.php b/src/models/jsonld/DeleteActionInterface.php new file mode 100644 index 000000000..74f44d2a2 --- /dev/null +++ b/src/models/jsonld/DeleteActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'appliesToDeliveryMethod' => ['DeliveryMethod'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleRegion' => ['GeoShape', 'Text', 'Place'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxPrice' => ['Number'], + 'minPrice' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'valueAddedTaxIncluded' => ['Boolean'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'appliesToDeliveryMethod', - 'areaServed', - 'eligibleRegion', - 'ineligibleRegion' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'appliesToDeliveryMethod' => ['DeliveryMethod'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'eligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'ineligibleRegion' => ['GeoShape', 'Place', 'Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'appliesToDeliveryMethod' => 'The delivery method(s) to which the delivery charge or payment charge specification applies.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also ineligibleRegion.', - 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also eligibleRegion.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'appliesToDeliveryMethod' => 'The delivery method(s) to which the delivery charge or payment charge specification applies.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'description' => 'A description of the item.', + '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.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also [[ineligibleRegion]]. ', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + '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.', + 'maxPrice' => 'The highest price if the price is a range.', + 'minPrice' => 'The lowest price if the price is a range.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'valueAddedTaxIncluded' => 'Specifies whether the applicable value-added tax (VAT) is included in the price specification or not.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The delivery method(s) to which the delivery charge or payment charge - * specification applies. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] - */ - public $appliesToDeliveryMethod; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is valid. See also ineligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $eligibleRegion; /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is not valid, e.g. a region where the transaction is - * not allowed. See also eligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] + * @inheritdoc */ - public $ineligibleRegion; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['appliesToDeliveryMethod', 'areaServed', 'eligibleRegion', 'ineligibleRegion'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DeliveryChargeSpecificationInterface.php b/src/models/jsonld/DeliveryChargeSpecificationInterface.php new file mode 100644 index 000000000..a99b29041 --- /dev/null +++ b/src/models/jsonld/DeliveryChargeSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'accessCode' => ['Text'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'availableFrom' => ['DateTime'], + 'availableThrough' => ['DateTime'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'hasDeliveryMethod' => ['DeliveryMethod'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accessCode', - 'availableFrom', - 'availableThrough', - 'hasDeliveryMethod' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accessCode' => ['Text'], - 'availableFrom' => ['DateTime'], - 'availableThrough' => ['DateTime'], - 'hasDeliveryMethod' => ['DeliveryMethod'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accessCode' => 'Password, PIN, or access code needed for delivery (e.g. from a locker).', - 'availableFrom' => 'When the item is available for pickup from the store, locker, etc.', - 'availableThrough' => 'After this date, the item will no longer be available for pickup.', - 'hasDeliveryMethod' => 'Method used for delivery or shipping.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'accessCode' => 'Password, PIN, or access code needed for delivery (e.g. from a locker).', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableFrom' => 'When the item is available for pickup from the store, locker, etc.', + 'availableThrough' => 'After this date, the item will no longer be available for pickup.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'hasDeliveryMethod' => 'Method used for delivery or shipping.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Password, PIN, or access code needed for delivery (e.g. from a locker). - * - * @var string [schema.org types: Text] - */ - public $accessCode; - /** - * When the item is available for pickup from the store, locker, etc. - * - * @var DateTime [schema.org types: DateTime] - */ - public $availableFrom; - /** - * After this date, the item will no longer be available for pickup. - * - * @var DateTime [schema.org types: DateTime] - */ - public $availableThrough; /** - * Method used for delivery or shipping. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] + * @inheritdoc */ - public $hasDeliveryMethod; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accessCode', 'availableFrom', 'availableThrough', 'hasDeliveryMethod'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DeliveryEventInterface.php b/src/models/jsonld/DeliveryEventInterface.php new file mode 100644 index 000000000..4809353c4 --- /dev/null +++ b/src/models/jsonld/DeliveryEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DeliveryMethodInterface.php b/src/models/jsonld/DeliveryMethodInterface.php new file mode 100644 index 000000000..7758fb974 --- /dev/null +++ b/src/models/jsonld/DeliveryMethodInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'deliveryTime' => ['ShippingDeliveryTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isUnlabelledFallback' => ['Boolean'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'shippingDestination' => ['DefinedRegion'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'transitTimeLabel' => ['Text'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'deliveryTime' => 'The total delay between the receipt of the order and the goods reaching the final customer.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isUnlabelledFallback' => 'This can be marked \'true\' to indicate that some published [[DeliveryTimeSettings]] or [[ShippingRateSettings]] are intended to apply to all [[OfferShippingDetails]] published by the same merchant, when referenced by a [[shippingSettingsLink]] in those settings. It is not meaningful to use a \'true\' value for this property alongside a transitTimeLabel (for [[DeliveryTimeSettings]]) or shippingLabel (for [[ShippingRateSettings]]), since this property is for use with unlabelled settings.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'shippingDestination' => 'indicates (possibly multiple) shipping destinations. These can be defined in several ways e.g. postalCode ranges.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'transitTimeLabel' => 'Label to match an [[OfferShippingDetails]] with a [[DeliveryTimeSettings]] (within the context of a [[shippingSettingsLink]] cross-reference).', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DeliveryTimeSettingsInterface.php b/src/models/jsonld/DeliveryTimeSettingsInterface.php new file mode 100644 index 000000000..e3ad4c497 --- /dev/null +++ b/src/models/jsonld/DeliveryTimeSettingsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptedPaymentMethod' => ['LoanOrCredit', 'PaymentMethod'], + 'additionalType' => ['URL'], + 'advanceBookingRequirement' => ['QuantitativeValue'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availability' => ['ItemAvailability'], + 'availabilityEnds' => ['Date', 'DateTime', 'Time'], + 'availabilityStarts' => ['Time', 'DateTime', 'Date'], + 'availableAtOrFrom' => ['Place'], + 'availableDeliveryMethod' => ['DeliveryMethod'], + 'businessFunction' => ['BusinessFunction'], + 'deliveryLeadTime' => ['QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleCustomerType' => ['BusinessEntityType'], + 'eligibleDuration' => ['QuantitativeValue'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleRegion' => ['GeoShape', 'Text', 'Place'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includesObject' => ['TypeAndQuantityNode'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'inventoryLevel' => ['QuantitativeValue'], + 'itemCondition' => ['OfferItemCondition'], + 'itemOffered' => ['Trip', 'Event', 'Product', 'AggregateOffer', 'CreativeWork', 'MenuItem', 'Service'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'priceSpecification' => ['PriceSpecification'], + 'sameAs' => ['URL'], + 'seller' => ['Organization', 'Person'], + 'serialNumber' => ['Text'], + 'sku' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'warranty' => ['WarrantyPromise'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptedPaymentMethod', - 'advanceBookingRequirement', - 'areaServed', - 'availability', - 'availabilityEnds', - 'availabilityStarts', - 'availableAtOrFrom', - 'availableDeliveryMethod', - 'businessFunction', - 'deliveryLeadTime', - 'eligibleCustomerType', - 'eligibleDuration', - 'eligibleQuantity', - 'eligibleRegion', - 'eligibleTransactionVolume', - 'gtin', - 'gtin12', - 'gtin13', - 'gtin14', - 'gtin8', - 'includesObject', - 'ineligibleRegion', - 'inventoryLevel', - 'itemCondition', - 'itemOffered', - 'mpn', - 'priceSpecification', - 'seller', - 'serialNumber', - 'sku', - 'validFrom', - 'validThrough', - 'warranty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptedPaymentMethod' => ['LoanOrCredit', 'PaymentMethod'], - 'advanceBookingRequirement' => ['QuantitativeValue'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'availability' => ['ItemAvailability'], - 'availabilityEnds' => ['Date', 'DateTime', 'Time'], - 'availabilityStarts' => ['Date', 'DateTime', 'Time'], - 'availableAtOrFrom' => ['Place'], - 'availableDeliveryMethod' => ['DeliveryMethod'], - 'businessFunction' => ['BusinessFunction'], - 'deliveryLeadTime' => ['QuantitativeValue'], - 'eligibleCustomerType' => ['BusinessEntityType'], - 'eligibleDuration' => ['QuantitativeValue'], - 'eligibleQuantity' => ['QuantitativeValue'], - 'eligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'eligibleTransactionVolume' => ['PriceSpecification'], - 'gtin' => ['Text'], - 'gtin12' => ['Text'], - 'gtin13' => ['Text'], - 'gtin14' => ['Text'], - 'gtin8' => ['Text'], - 'includesObject' => ['TypeAndQuantityNode'], - 'ineligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'inventoryLevel' => ['QuantitativeValue'], - 'itemCondition' => ['OfferItemCondition'], - 'itemOffered' => ['AggregateOffer', 'CreativeWork', 'Event', 'MenuItem', 'Product', 'Service', 'Trip'], - 'mpn' => ['Text'], - 'priceSpecification' => ['PriceSpecification'], - 'seller' => ['Organization', 'Person'], - 'serialNumber' => ['Text'], - 'sku' => ['Text'], - 'validFrom' => ['Date', 'DateTime'], - 'validThrough' => ['Date', 'DateTime'], - 'warranty' => ['WarrantyPromise'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptedPaymentMethod' => 'The payment method(s) accepted by seller for this offer.', - 'advanceBookingRequirement' => 'The amount of time that is required between accepting the offer and the actual usage of the resource or service.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'availability' => 'The availability of this item—for example In stock, Out of stock, Pre-order, etc.', - 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', - 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', - 'availableAtOrFrom' => 'The place(s) from which the offer can be obtained (e.g. store locations).', - 'availableDeliveryMethod' => 'The delivery method(s) available for this offer.', - 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', - 'deliveryLeadTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup.', - 'eligibleCustomerType' => 'The type(s) of customers for which the given offer is valid.', - 'eligibleDuration' => 'The duration for which the given offer is valid.', - 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', - 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also ineligibleRegion.', - 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', - 'gtin' => 'A Global Trade Item Number (GTIN). GTINs identify trade items, including products and services, using numeric identification codes. The gtin property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 properties. The GS1 digital link specifications express GTINs as URLs. A correct gtin value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a valid GS1 check digit and meet the other rules for valid GTINs. See also GS1\'s GTIN Summary and Wikipedia for more details. Left-padding of the gtin values is not required or encouraged.', - 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See GS1 GTIN Summary for more details.', - 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceeding zero. See GS1 GTIN Summary for more details.', - 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See GS1 GTIN Summary for more details.', - 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary for more details.', - 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in the offer.', - 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also eligibleRegion.', - 'inventoryLevel' => 'The current approximate inventory level for the item or items.', - 'itemCondition' => 'A predefined value from OfferItemCondition or a textual description of the condition of the product or service, or the products or services included in the offer.', - 'itemOffered' => 'An item being offered (or demanded). The transactional nature of the offer or demand is documented using businessFunction, e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer. Inverse property: offers.', - 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', - 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', - 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider. Supersedes merchant, vendor.', - 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', - 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', - 'validFrom' => 'The date when the item becomes valid.', - 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', - 'warranty' => 'The warranty promise(s) included in the offer. Supersedes warrantyPromise.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The payment method(s) accepted by seller for this offer. - * - * @var mixed|LoanOrCredit|PaymentMethod [schema.org types: LoanOrCredit, PaymentMethod] - */ - public $acceptedPaymentMethod; /** - * The amount of time that is required between accepting the offer and the - * actual usage of the resource or service. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $advanceBookingRequirement; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * The availability of this item—for example In stock, Out of stock, - * Pre-order, etc. - * - * @var ItemAvailability [schema.org types: ItemAvailability] - */ - public $availability; - /** - * The end of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] - */ - public $availabilityEnds; - /** - * The beginning of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] - */ - public $availabilityStarts; - /** - * The place(s) from which the offer can be obtained (e.g. store locations). - * - * @var Place [schema.org types: Place] - */ - public $availableAtOrFrom; - /** - * The delivery method(s) available for this offer. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] - */ - public $availableDeliveryMethod; - /** - * The business function (e.g. sell, lease, repair, dispose) of the offer or - * component of a bundle (TypeAndQuantityNode). The default is - * http://purl.org/goodrelations/v1#Sell. - * - * @var BusinessFunction [schema.org types: BusinessFunction] - */ - public $businessFunction; - /** - * The typical delay between the receipt of the order and the goods either - * leaving the warehouse or being prepared for pickup, in case the delivery - * method is on site pickup. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $deliveryLeadTime; - /** - * The type(s) of customers for which the given offer is valid. - * - * @var BusinessEntityType [schema.org types: BusinessEntityType] - */ - public $eligibleCustomerType; - /** - * The duration for which the given offer is valid. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $eligibleDuration; - /** - * The interval and unit of measurement of ordering quantities for which the - * offer or price specification is valid. This allows e.g. specifying that a - * certain freight charge is valid only for a certain quantity. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $eligibleQuantity; - /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is valid. See also ineligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $eligibleRegion; - /** - * The transaction volume, in a monetary unit, for which the offer or price - * specification is valid, e.g. for indicating a minimal purchasing volume, to - * express free shipping above a certain order volume, or to limit the - * acceptance of credit cards to purchases to a certain minimal amount. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $eligibleTransactionVolume; - /** - * A Global Trade Item Number (GTIN). GTINs identify trade items, including - * products and services, using numeric identification codes. The gtin - * property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 - * properties. The GS1 digital link specifications express GTINs as URLs. A - * correct gtin value should be a valid GTIN, which means that it should be an - * all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital - * Link" URL based on such a string. The numeric component should also have a - * valid GS1 check digit and meet the other rules for valid GTINs. See also - * GS1's GTIN Summary and Wikipedia for more details. Left-padding of the gtin - * values is not required or encouraged. - * - * @var string [schema.org types: Text] - */ - public $gtin; - /** - * The GTIN-12 code of the product, or the product to which the offer refers. - * The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. - * Company Prefix, Item Reference, and Check Digit used to identify trade - * items. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin12; - /** - * The GTIN-13 code of the product, or the product to which the offer refers. - * This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit - * UPC codes can be converted into a GTIN-13 code by simply adding a - * preceeding zero. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin13; - /** - * The GTIN-14 code of the product, or the product to which the offer refers. - * See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin14; - /** - * The GTIN-8 code of the product, or the product to which the offer refers. - * This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary - * for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin8; - /** - * This links to a node or nodes indicating the exact quantity of the products - * included in the offer. - * - * @var TypeAndQuantityNode [schema.org types: TypeAndQuantityNode] - */ - public $includesObject; - /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is not valid, e.g. a region where the transaction is - * not allowed. See also eligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $ineligibleRegion; - /** - * The current approximate inventory level for the item or items. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $inventoryLevel; - /** - * A predefined value from OfferItemCondition or a textual description of the - * condition of the product or service, or the products or services included - * in the offer. - * - * @var OfferItemCondition [schema.org types: OfferItemCondition] - */ - public $itemCondition; - /** - * An item being offered (or demanded). The transactional nature of the offer - * or demand is documented using businessFunction, e.g. sell, lease etc. While - * several common expected types are listed explicitly in this definition, - * others can be used. Using a second type, such as Product or a subtype of - * Product, can clarify the nature of the offer. Inverse property: offers. - * - * @var mixed|AggregateOffer|CreativeWork|Event|MenuItem|Product|Service|Trip [schema.org types: AggregateOffer, CreativeWork, Event, MenuItem, Product, Service, Trip] - */ - public $itemOffered; - /** - * The Manufacturer Part Number (MPN) of the product, or the product to which - * the offer refers. - * - * @var string [schema.org types: Text] - */ - public $mpn; - /** - * One or more detailed price specifications, indicating the unit price and - * delivery or payment charges. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $priceSpecification; - /** - * An entity which offers (sells / leases / lends / loans) the services / - * goods. A seller may also be a provider. Supersedes merchant, vendor. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $seller; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptedPaymentMethod' => 'The payment method(s) accepted by seller for this offer.', + '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.', + 'advanceBookingRequirement' => 'The amount of time that is required between accepting the offer and the actual usage of the resource or service.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availability' => 'The availability of this item—for example In stock, Out of stock, Pre-order, etc.', + 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', + 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', + 'availableAtOrFrom' => 'The place(s) from which the offer can be obtained (e.g. store locations).', + 'availableDeliveryMethod' => 'The delivery method(s) available for this offer.', + 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', + 'deliveryLeadTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup.', + 'description' => 'A description of the item.', + '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.', + 'eligibleCustomerType' => 'The type(s) of customers for which the given offer is valid.', + 'eligibleDuration' => 'The duration for which the given offer is valid.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also [[ineligibleRegion]]. ', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in an [[Offer]] or [[ProductCollection]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'inventoryLevel' => 'The current approximate inventory level for the item or items.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + 'itemOffered' => 'An item being offered (or demanded). The transactional nature of the offer or demand is documented using [[businessFunction]], e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.', + '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.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider.', + 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'warranty' => 'The warranty promise(s) included in the offer.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The serial number or any alphanumeric identifier of a particular product. - * When attached to an offer, it is a shortcut for the serial number of the - * product included in the offer. - * - * @var string [schema.org types: Text] - */ - public $serialNumber; - /** - * The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a - * product or service, or the product to which the offer refers. - * - * @var string [schema.org types: Text] - */ - public $sku; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; /** - * The date after when the item is not valid. For example the end of an offer, - * salary period, or a period of opening hours. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validThrough; - /** - * The warranty promise(s) included in the offer. Supersedes warrantyPromise. - * - * @var WarrantyPromise [schema.org types: WarrantyPromise] + * @inheritdoc */ - public $warranty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptedPaymentMethod', 'advanceBookingRequirement', 'areaServed', 'availability', 'availabilityEnds', 'availabilityStarts', 'availableAtOrFrom', 'availableDeliveryMethod', 'businessFunction', 'deliveryLeadTime', 'eligibleCustomerType', 'eligibleDuration', 'eligibleQuantity', 'eligibleRegion', 'eligibleTransactionVolume', 'gtin', 'gtin12', 'gtin13', 'gtin14', 'gtin8', 'includesObject', 'ineligibleRegion', 'inventoryLevel', 'itemCondition', 'itemOffered', 'mpn', 'priceSpecification', 'seller', 'serialNumber', 'sku', 'validFrom', 'validThrough', 'warranty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DemandInterface.php b/src/models/jsonld/DemandInterface.php new file mode 100644 index 000000000..aabeaca84 --- /dev/null +++ b/src/models/jsonld/DemandInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DemoAlbumInterface.php b/src/models/jsonld/DemoAlbumInterface.php new file mode 100644 index 000000000..b07e09cbe --- /dev/null +++ b/src/models/jsonld/DemoAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DemoGameAvailabilityInterface.php b/src/models/jsonld/DemoGameAvailabilityInterface.php new file mode 100644 index 000000000..e3700f3f6 --- /dev/null +++ b/src/models/jsonld/DemoGameAvailabilityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthPlanNetworkId' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAcceptingNewPatients' => ['Boolean'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'medicalSpecialty' => ['MedicalSpecialty'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'medicalSpecialty' => 'A medical specialty of the provider.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DentistInterface.php b/src/models/jsonld/DentistInterface.php new file mode 100644 index 000000000..a7a1fa447 --- /dev/null +++ b/src/models/jsonld/DentistInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DentistryInterface.php b/src/models/jsonld/DentistryInterface.php new file mode 100644 index 000000000..6cd39e839 --- /dev/null +++ b/src/models/jsonld/DentistryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'fromLocation', - 'toLocation' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'fromLocation' => ['Place'], - 'toLocation' => ['Place'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action. A sub property of location. The original location of the object or the agent before the action.', - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The original location of the object or the - * agent before the action. A sub property of location. The original location - * of the object or the agent before the action. - * - * @var Place [schema.org types: Place] - */ - public $fromLocation; - /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['fromLocation', 'toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DepartActionInterface.php b/src/models/jsonld/DepartActionInterface.php new file mode 100644 index 000000000..e35d18086 --- /dev/null +++ b/src/models/jsonld/DepartActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DepartmentStoreInterface.php b/src/models/jsonld/DepartmentStoreInterface.php new file mode 100644 index 000000000..397b10c0b --- /dev/null +++ b/src/models/jsonld/DepartmentStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accountMinimumInflow' => ['MonetaryAmount'], + 'accountOverdraftLimit' => ['MonetaryAmount'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'bankAccountType' => ['Text', 'URL'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accountMinimumInflow', - 'accountOverdraftLimit', - 'bankAccountType' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accountMinimumInflow' => ['MonetaryAmount'], - 'accountOverdraftLimit' => ['MonetaryAmount'], - 'bankAccountType' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'accountMinimumInflow' => 'A minimum amount that has to be paid in every month.', - 'accountOverdraftLimit' => 'An overdraft is an extension of credit from a lending institution when an account reaches zero. An overdraft allows the individual to continue withdrawing money even if the account has no funds in it. Basically the bank allows people to borrow a set amount of money.', - 'bankAccountType' => 'The type of a bank account.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accountMinimumInflow' => 'A minimum amount that has to be paid in every month.', + 'accountOverdraftLimit' => 'An overdraft is an extension of credit from a lending institution when an account reaches zero. An overdraft allows the individual to continue withdrawing money even if the account has no funds in it. Basically the bank allows people to borrow a set amount of money.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'bankAccountType' => 'The type of a bank account.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A minimum amount that has to be paid in every month. - * - * @var MonetaryAmount [schema.org types: MonetaryAmount] - */ - public $accountMinimumInflow; - /** - * An overdraft is an extension of credit from a lending institution when an - * account reaches zero. An overdraft allows the individual to continue - * withdrawing money even if the account has no funds in it. Basically the - * bank allows people to borrow a set amount of money. - * - * @var MonetaryAmount [schema.org types: MonetaryAmount] - */ - public $accountOverdraftLimit; /** - * The type of a bank account. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $bankAccountType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accountMinimumInflow', 'accountOverdraftLimit', 'bankAccountType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DepositAccountInterface.php b/src/models/jsonld/DepositAccountInterface.php new file mode 100644 index 000000000..ee0382044 --- /dev/null +++ b/src/models/jsonld/DepositAccountInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DermatologicInterface.php b/src/models/jsonld/DermatologicInterface.php new file mode 100644 index 000000000..6f9637dfa --- /dev/null +++ b/src/models/jsonld/DermatologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DermatologyInterface.php b/src/models/jsonld/DermatologyInterface.php new file mode 100644 index 000000000..8c5b93816 --- /dev/null +++ b/src/models/jsonld/DermatologyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DesktopWebPlatformInterface.php b/src/models/jsonld/DesktopWebPlatformInterface.php new file mode 100644 index 000000000..ad60a2776 --- /dev/null +++ b/src/models/jsonld/DesktopWebPlatformInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DiabeticDietInterface.php b/src/models/jsonld/DiabeticDietInterface.php new file mode 100644 index 000000000..cf07a4f84 --- /dev/null +++ b/src/models/jsonld/DiabeticDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DiagnosticInterface.php b/src/models/jsonld/DiagnosticInterface.php new file mode 100644 index 000000000..c6110d7e4 --- /dev/null +++ b/src/models/jsonld/DiagnosticInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availableTest' => ['MedicalTest'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthPlanNetworkId' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAcceptingNewPatients' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'medicalSpecialty' => ['MedicalSpecialty'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'availableTest' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availableTest' => 'A diagnostic test or procedure offered by this lab.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'medicalSpecialty' => 'A medical specialty of the provider.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'availableTest' => ['MedicalTest'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'availableTest' => 'A diagnostic test or procedure offered by this lab.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A diagnostic test or procedure offered by this lab. - * - * @var MedicalTest [schema.org types: MedicalTest] + * @inheritdoc */ - public $availableTest; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['availableTest'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DiagnosticLabInterface.php b/src/models/jsonld/DiagnosticLabInterface.php new file mode 100644 index 000000000..4e76ed39a --- /dev/null +++ b/src/models/jsonld/DiagnosticLabInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bodyLocation', - 'followup', - 'howPerformed', - 'preparation', - 'procedureType', - 'status' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bodyLocation' => ['Text'], - 'followup' => ['Text'], - 'howPerformed' => ['Text'], - 'preparation' => ['MedicalEntity', 'Text'], - 'procedureType' => ['MedicalProcedureType'], - 'status' => ['EventStatusType', 'MedicalStudyStatus', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bodyLocation' => 'Location in the body of the anatomical structure.', - 'followup' => 'Typical or recommended followup care after the procedure is performed.', - 'howPerformed' => 'How the procedure is performed.', - 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', - 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', - 'status' => 'The status of the study (enumerated).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * Location in the body of the anatomical structure. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $bodyLocation; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Typical or recommended followup care after the procedure is performed. - * - * @var string [schema.org types: Text] - */ - public $followup; /** - * How the procedure is performed. - * - * @var string [schema.org types: Text] - */ - public $howPerformed; - /** - * Typical preparation that a patient must undergo before having the procedure - * performed. - * - * @var mixed|MedicalEntity|string [schema.org types: MedicalEntity, Text] - */ - public $preparation; - /** - * The type of procedure, for example Surgical, Noninvasive, or Percutaneous. - * - * @var MedicalProcedureType [schema.org types: MedicalProcedureType] - */ - public $procedureType; - /** - * The status of the study (enumerated). - * - * @var mixed|EventStatusType|MedicalStudyStatus|string [schema.org types: EventStatusType, MedicalStudyStatus, Text] + * @inheritdoc */ - public $status; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bodyLocation', 'followup', 'howPerformed', 'preparation', 'procedureType', 'status'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DiagnosticProcedureInterface.php b/src/models/jsonld/DiagnosticProcedureInterface.php new file mode 100644 index 000000000..62dafac1c --- /dev/null +++ b/src/models/jsonld/DiagnosticProcedureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'code' => ['MedicalCode'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'dietFeatures' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endorsers' => ['Person', 'Organization'], + 'exampleOfWork' => ['CreativeWork'], + 'expertConsiderations' => ['Text'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'guideline' => ['MedicalGuideline'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'medicineSystem' => ['MedicineSystem'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'physiologicalBenefits' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recognizingAuthority' => ['Organization'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'risks' => ['Text'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dietFeatures', - 'endorsers', - 'expertConsiderations', - 'physiologicalBenefits', - 'risks' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dietFeatures' => ['Text'], - 'endorsers' => ['Organization', 'Person'], - 'expertConsiderations' => ['Text'], - 'physiologicalBenefits' => ['Text'], - 'risks' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dietFeatures' => 'Nutritional information specific to the dietary plan. May include dietary recommendations on what foods to avoid, what foods to consume, and specific alterations/deviations from the USDA or other regulatory body\'s approved dietary guidelines.', - 'endorsers' => 'People or organizations that endorse the plan.', - 'expertConsiderations' => 'Medical expert advice related to the plan.', - 'physiologicalBenefits' => 'Specific physiologic benefits associated to the plan.', - 'risks' => 'Specific physiologic risks associated to the diet plan.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + 'dietFeatures' => 'Nutritional information specific to the dietary plan. May include dietary recommendations on what foods to avoid, what foods to consume, and specific alterations/deviations from the USDA or other regulatory body\'s approved dietary guidelines.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endorsers' => 'People or organizations that endorse the plan.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expertConsiderations' => 'Medical expert advice related to the plan.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'guideline' => 'A medical guideline related to this entity.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'physiologicalBenefits' => 'Specific physiologic benefits associated to the plan.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + 'risks' => 'Specific physiologic risks associated to the diet plan.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * Nutritional information specific to the dietary plan. May include dietary - * recommendations on what foods to avoid, what foods to consume, and specific - * alterations/deviations from the USDA or other regulatory body's approved - * dietary guidelines. - * - * @var string [schema.org types: Text] - */ - public $dietFeatures; - /** - * People or organizations that endorse the plan. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $endorsers; - /** - * Medical expert advice related to the plan. - * - * @var string [schema.org types: Text] - */ - public $expertConsiderations; - /** - * Specific physiologic benefits associated to the plan. - * - * @var string [schema.org types: Text] - */ - public $physiologicalBenefits; - /** - * Specific physiologic risks associated to the diet plan. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $risks; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dietFeatures', 'endorsers', 'expertConsiderations', 'physiologicalBenefits', 'risks'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DietInterface.php b/src/models/jsonld/DietInterface.php new file mode 100644 index 000000000..96aec33d7 --- /dev/null +++ b/src/models/jsonld/DietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DietNutritionInterface.php b/src/models/jsonld/DietNutritionInterface.php new file mode 100644 index 000000000..0e007e496 --- /dev/null +++ b/src/models/jsonld/DietNutritionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'activeIngredient' => ['Text'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isProprietary' => ['Boolean'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'maximumIntake' => ['MaximumDoseSchedule'], + 'mechanismOfAction' => ['Text'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'nonProprietaryName' => ['Text'], + 'potentialAction' => ['Action'], + 'proprietaryName' => ['Text'], + 'recognizingAuthority' => ['Organization'], + 'recommendedIntake' => ['RecommendedDoseSchedule'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'safetyConsideration' => ['Text'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'targetPopulation' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'activeIngredient', - 'isProprietary', - 'legalStatus', - 'manufacturer', - 'maximumIntake', - 'mechanismOfAction', - 'nonProprietaryName', - 'proprietaryName', - 'recommendedIntake', - 'safetyConsideration', - 'targetPopulation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'activeIngredient' => ['Text'], - 'isProprietary' => ['Boolean'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'manufacturer' => ['Organization'], - 'maximumIntake' => ['MaximumDoseSchedule'], - 'mechanismOfAction' => ['Text'], - 'nonProprietaryName' => ['Text'], - 'proprietaryName' => ['Text'], - 'recommendedIntake' => ['RecommendedDoseSchedule'], - 'safetyConsideration' => ['Text'], - 'targetPopulation' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'activeIngredient' => 'An active ingredient, typically chemical compounds and/or biologic substances.', - 'isProprietary' => 'True if this item\'s name is a proprietary/brand name (vs. generic name).', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'manufacturer' => 'The manufacturer of the product.', - 'maximumIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.', - 'mechanismOfAction' => 'The specific biochemical interaction through which this drug or supplement produces its pharmacological effect.', - 'nonProprietaryName' => 'The generic name of this drug or supplement.', - 'proprietaryName' => 'Proprietary name given to the diet plan, typically by its originator or creator.', - 'recommendedIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.', - 'safetyConsideration' => 'Any potential safety concern associated with the supplement. May include interactions with other drugs and foods, pregnancy, breastfeeding, known adverse reactions, and documented efficacy of the supplement.', - 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An active ingredient, typically chemical compounds and/or biologic - * substances. - * - * @var string [schema.org types: Text] - */ - public $activeIngredient; - /** - * True if this item's name is a proprietary/brand name (vs. generic name). - * - * @var bool [schema.org types: Boolean] - */ - public $isProprietary; - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The manufacturer of the product. - * - * @var Organization [schema.org types: Organization] - */ - public $manufacturer; - /** - * Recommended intake of this supplement for a given population as defined by - * a specific recommending authority. - * - * @var MaximumDoseSchedule [schema.org types: MaximumDoseSchedule] - */ - public $maximumIntake; - /** - * The specific biochemical interaction through which this drug or supplement - * produces its pharmacological effect. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $mechanismOfAction; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'activeIngredient' => 'An active ingredient, typically chemical compounds and/or biologic substances.', + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isProprietary' => 'True if this item\'s name is a proprietary/brand name (vs. generic name).', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'maximumIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.', + 'mechanismOfAction' => 'The specific biochemical interaction through which this drug or supplement produces its pharmacological effect.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'nonProprietaryName' => 'The generic name of this drug or supplement.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'proprietaryName' => 'Proprietary name given to the diet plan, typically by its originator or creator.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'recommendedIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'safetyConsideration' => 'Any potential safety concern associated with the supplement. May include interactions with other drugs and foods, pregnancy, breastfeeding, known adverse reactions, and documented efficacy of the supplement.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The generic name of this drug or supplement. - * - * @var string [schema.org types: Text] - */ - public $nonProprietaryName; - /** - * Proprietary name given to the diet plan, typically by its originator or - * creator. - * - * @var string [schema.org types: Text] - */ - public $proprietaryName; - /** - * Recommended intake of this supplement for a given population as defined by - * a specific recommending authority. - * - * @var RecommendedDoseSchedule [schema.org types: RecommendedDoseSchedule] - */ - public $recommendedIntake; - /** - * Any potential safety concern associated with the supplement. May include - * interactions with other drugs and foods, pregnancy, breastfeeding, known - * adverse reactions, and documented efficacy of the supplement. - * - * @var string [schema.org types: Text] - */ - public $safetyConsideration; /** - * Characteristics of the population for which this is intended, or which - * typically uses it, e.g. 'adults'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $targetPopulation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['activeIngredient', 'isProprietary', 'legalStatus', 'manufacturer', 'maximumIntake', 'mechanismOfAction', 'nonProprietaryName', 'proprietaryName', 'recommendedIntake', 'safetyConsideration', 'targetPopulation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DietarySupplementInterface.php b/src/models/jsonld/DietarySupplementInterface.php new file mode 100644 index 000000000..42233a880 --- /dev/null +++ b/src/models/jsonld/DietarySupplementInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DigitalAudioTapeFormatInterface.php b/src/models/jsonld/DigitalAudioTapeFormatInterface.php new file mode 100644 index 000000000..3106dde45 --- /dev/null +++ b/src/models/jsonld/DigitalAudioTapeFormatInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'hasDigitalDocumentPermission' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A permission related to the access to this document (e.g. permission to - * read or write an electronic document). For a public document, specify a - * grantee with an Audience with audienceType equal to "public". - * - * @var DigitalDocumentPermission [schema.org types: DigitalDocumentPermission] + * @inheritdoc */ - public $hasDigitalDocumentPermission; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasDigitalDocumentPermission'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DigitalDocumentInterface.php b/src/models/jsonld/DigitalDocumentInterface.php new file mode 100644 index 000000000..845cee42a --- /dev/null +++ b/src/models/jsonld/DigitalDocumentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'grantee' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'permissionType' => ['DigitalDocumentPermissionType'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'grantee', - 'permissionType' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'grantee' => ['Audience', 'ContactPoint', 'Organization', 'Person'], - 'permissionType' => ['DigitalDocumentPermissionType'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'grantee' => 'The person, organization, contact point, or audience that has been granted this permission.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'permissionType' => 'The type of permission granted the person, organization, or audience.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'grantee' => 'The person, organization, contact point, or audience that has been granted this permission.', - 'permissionType' => 'The type of permission granted the person, organization, or audience.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The person, organization, contact point, or audience that has been granted - * this permission. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] - */ - public $grantee; - /** - * The type of permission granted the person, organization, or audience. - * - * @var DigitalDocumentPermissionType [schema.org types: DigitalDocumentPermissionType] + * @inheritdoc */ - public $permissionType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['grantee', 'permissionType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DigitalDocumentPermissionInterface.php b/src/models/jsonld/DigitalDocumentPermissionInterface.php new file mode 100644 index 000000000..9321d3630 --- /dev/null +++ b/src/models/jsonld/DigitalDocumentPermissionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DigitalDocumentPermissionTypeInterface.php b/src/models/jsonld/DigitalDocumentPermissionTypeInterface.php new file mode 100644 index 000000000..b08c623c4 --- /dev/null +++ b/src/models/jsonld/DigitalDocumentPermissionTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DigitalFormatInterface.php b/src/models/jsonld/DigitalFormatInterface.php new file mode 100644 index 000000000..64ce431fb --- /dev/null +++ b/src/models/jsonld/DigitalFormatInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DigitalPlatformEnumerationInterface.php b/src/models/jsonld/DigitalPlatformEnumerationInterface.php new file mode 100644 index 000000000..0c2d78d77 --- /dev/null +++ b/src/models/jsonld/DigitalPlatformEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DisabilitySupportInterface.php b/src/models/jsonld/DisabilitySupportInterface.php new file mode 100644 index 000000000..d6379c19a --- /dev/null +++ b/src/models/jsonld/DisabilitySupportInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DisagreeActionInterface.php b/src/models/jsonld/DisagreeActionInterface.php new file mode 100644 index 000000000..1ca19df7b --- /dev/null +++ b/src/models/jsonld/DisagreeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DiscontinuedInterface.php b/src/models/jsonld/DiscontinuedInterface.php new file mode 100644 index 000000000..759840461 --- /dev/null +++ b/src/models/jsonld/DiscontinuedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DiscoverActionInterface.php b/src/models/jsonld/DiscoverActionInterface.php new file mode 100644 index 000000000..a38f607a0 --- /dev/null +++ b/src/models/jsonld/DiscoverActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sharedContent' => ['CreativeWork'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'sharedContent' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sharedContent' => 'A CreativeWork such as an image, video, or audio clip shared as part of this posting.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'sharedContent' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'sharedContent' => 'A CreativeWork such as an image, video, or audio clip shared as part of this posting.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CreativeWork such as an image, video, or audio clip shared as part of - * this posting. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $sharedContent; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['sharedContent'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DiscussionForumPostingInterface.php b/src/models/jsonld/DiscussionForumPostingInterface.php new file mode 100644 index 000000000..befed6be0 --- /dev/null +++ b/src/models/jsonld/DiscussionForumPostingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DislikeActionInterface.php b/src/models/jsonld/DislikeActionInterface.php new file mode 100644 index 000000000..4d8fe9b0f --- /dev/null +++ b/src/models/jsonld/DislikeActionInterface.php @@ -0,0 +1,24 @@ + '. E.g., '7 ft'. + * schema.org version: v14.0-release + * Distance - Properties that take Distances as values are of the form ' '. E.g., '7 ft'. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Distance + * @see https://schema.org/Distance */ -class Distance extends Quantity +class Distance extends MetaJsonLd implements DistanceInterface, QuantityInterface, IntangibleInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -32,274 +32,115 @@ class Distance extends Quantity * * @var string */ - static public $schemaTypeName = 'Distance'; + static public string $schemaTypeName = 'Distance'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Distance'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'Properties that take Distances as values are of the form \' \'. E.g., \'7 ft\'.'; + static public string $schemaTypeScope = 'https://schema.org/Distance'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Quantity'; + static public string $schemaTypeExtends = 'Quantity'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = << '. E.g., '7 ft'. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use DistanceTrait; + use QuantityTrait; + use IntangibleTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DistanceFee.php b/src/models/jsonld/DistanceFee.php new file mode 100644 index 000000000..920a946f5 --- /dev/null +++ b/src/models/jsonld/DistanceFee.php @@ -0,0 +1,151 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DistanceFeeInterface.php b/src/models/jsonld/DistanceFeeInterface.php new file mode 100644 index 000000000..6f1825366 --- /dev/null +++ b/src/models/jsonld/DistanceFeeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DistilleryInterface.php b/src/models/jsonld/DistilleryInterface.php new file mode 100644 index 000000000..b8db28bcd --- /dev/null +++ b/src/models/jsonld/DistilleryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'recipient' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DonateActionInterface.php b/src/models/jsonld/DonateActionInterface.php new file mode 100644 index 000000000..4beb61558 --- /dev/null +++ b/src/models/jsonld/DonateActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseUnit' => ['Text'], + 'doseValue' => ['Number', 'QualitativeValue'], + 'frequency' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'targetPopulation' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'doseUnit', - 'doseValue', - 'frequency', - 'targetPopulation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'doseUnit' => ['Text'], - 'doseValue' => ['Number', 'QualitativeValue'], - 'frequency' => ['Text'], - 'targetPopulation' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'doseUnit' => 'The unit of the dose, e.g. \'mg\'.', - 'doseValue' => 'The value of the dose, e.g. 500.', - 'frequency' => 'How often the dose is taken, e.g. \'daily\'.', - 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'doseUnit' => 'The unit of the dose, e.g. \'mg\'.', + 'doseValue' => 'The value of the dose, e.g. 500.', + 'frequency' => 'How often the dose is taken, e.g. \'daily\'.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The unit of the dose, e.g. 'mg'. - * - * @var string [schema.org types: Text] - */ - public $doseUnit; - /** - * The value of the dose, e.g. 500. - * - * @var mixed|float|QualitativeValue [schema.org types: Number, QualitativeValue] - */ - public $doseValue; - /** - * How often the dose is taken, e.g. 'daily'. - * - * @var string [schema.org types: Text] - */ - public $frequency; /** - * Characteristics of the population for which this is intended, or which - * typically uses it, e.g. 'adults'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $targetPopulation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['doseUnit', 'doseValue', 'frequency', 'targetPopulation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DoseScheduleInterface.php b/src/models/jsonld/DoseScheduleInterface.php new file mode 100644 index 000000000..ad236e494 --- /dev/null +++ b/src/models/jsonld/DoseScheduleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DoubleBlindedTrialInterface.php b/src/models/jsonld/DoubleBlindedTrialInterface.php new file mode 100644 index 000000000..31e06d395 --- /dev/null +++ b/src/models/jsonld/DoubleBlindedTrialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'fromLocation', - 'toLocation' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'fromLocation' => ['Place'], - 'toLocation' => ['Place'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The original location of the object or the - * agent before the action. - * - * @var Place [schema.org types: Place] - */ - public $fromLocation; - /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['fromLocation', 'toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DownloadActionInterface.php b/src/models/jsonld/DownloadActionInterface.php new file mode 100644 index 000000000..01b826a9c --- /dev/null +++ b/src/models/jsonld/DownloadActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DownpaymentInterface.php b/src/models/jsonld/DownpaymentInterface.php new file mode 100644 index 000000000..47f0d1f6b --- /dev/null +++ b/src/models/jsonld/DownpaymentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrawActionInterface.php b/src/models/jsonld/DrawActionInterface.php new file mode 100644 index 000000000..3e7f76a55 --- /dev/null +++ b/src/models/jsonld/DrawActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrawingInterface.php b/src/models/jsonld/DrawingInterface.php new file mode 100644 index 000000000..2be4cc7f4 --- /dev/null +++ b/src/models/jsonld/DrawingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrinkActionInterface.php b/src/models/jsonld/DrinkActionInterface.php new file mode 100644 index 000000000..76a067d87 --- /dev/null +++ b/src/models/jsonld/DrinkActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'equal', - 'greater', - 'greaterOrEqual', - 'lesser', - 'lesserOrEqual', - 'nonEqual', - 'valueReference' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'equal' => ['QualitativeValue'], - 'greater' => ['QualitativeValue'], - 'greaterOrEqual' => ['QualitativeValue'], - 'lesser' => ['QualitativeValue'], - 'lesserOrEqual' => ['QualitativeValue'], - 'nonEqual' => ['QualitativeValue'], - 'valueReference' => ['Enumeration', 'PropertyValue', 'QualitativeValue', 'QuantitativeValue', 'StructuredValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', - 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', - 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', - 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', - 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', - 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', - 'valueReference' => 'A pointer to a secondary value that provides additional information on the original value, e.g. a reference temperature.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * This ordering relation for qualitative values indicates that the subject is - * equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $equal; - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] + * @inheritdoc */ - public $greater; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $greaterOrEqual; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesser; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesserOrEqual; /** - * This ordering relation for qualitative values indicates that the subject is - * not equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $nonEqual; - /** - * A pointer to a secondary value that provides additional information on the - * original value, e.g. a reference temperature. - * - * @var mixed|Enumeration|PropertyValue|QualitativeValue|QuantitativeValue|StructuredValue [schema.org types: Enumeration, PropertyValue, QualitativeValue, QuantitativeValue, StructuredValue] + * @inheritdoc */ - public $valueReference; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'equal', 'greater', 'greaterOrEqual', 'lesser', 'lesserOrEqual', 'nonEqual', 'valueReference'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DriveWheelConfigurationValueInterface.php b/src/models/jsonld/DriveWheelConfigurationValueInterface.php new file mode 100644 index 000000000..cedd39403 --- /dev/null +++ b/src/models/jsonld/DriveWheelConfigurationValueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/DrivingSchoolVehicleUsageInterface.php b/src/models/jsonld/DrivingSchoolVehicleUsageInterface.php new file mode 100644 index 000000000..4abccee2e --- /dev/null +++ b/src/models/jsonld/DrivingSchoolVehicleUsageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'activeIngredient' => ['Text'], + 'additionalType' => ['URL'], + 'administrationRoute' => ['Text'], + 'alcoholWarning' => ['Text'], + 'alternateName' => ['Text'], + 'availableStrength' => ['DrugStrength'], + 'breastfeedingWarning' => ['Text'], + 'clincalPharmacology' => ['Text'], + 'clinicalPharmacology' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dosageForm' => ['Text'], + 'doseSchedule' => ['DoseSchedule'], + 'drugClass' => ['DrugClass'], + 'drugUnit' => ['Text'], + 'foodWarning' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includedInHealthInsurancePlan' => ['HealthInsurancePlan'], + 'interactingDrug' => ['Drug'], + 'isAvailableGenerically' => ['Boolean'], + 'isProprietary' => ['Boolean'], + 'labelDetails' => ['URL'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'maximumIntake' => ['MaximumDoseSchedule'], + 'mechanismOfAction' => ['Text'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'nonProprietaryName' => ['Text'], + 'overdosage' => ['Text'], + 'potentialAction' => ['Action'], + 'pregnancyCategory' => ['DrugPregnancyCategory'], + 'pregnancyWarning' => ['Text'], + 'prescribingInfo' => ['URL'], + 'prescriptionStatus' => ['DrugPrescriptionStatus', 'Text'], + 'proprietaryName' => ['Text'], + 'recognizingAuthority' => ['Organization'], + 'relatedDrug' => ['Drug'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'rxcui' => ['Text'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'warning' => ['URL', 'Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'activeIngredient', - 'administrationRoute', - 'alcoholWarning', - 'availableStrength', - 'breastfeedingWarning', - 'clinicalPharmacology', - 'dosageForm', - 'doseSchedule', - 'drugClass', - 'drugUnit', - 'foodWarning', - 'includedInHealthInsurancePlan', - 'interactingDrug', - 'isAvailableGenerically', - 'isProprietary', - 'labelDetails', - 'legalStatus', - 'manufacturer', - 'maximumIntake', - 'mechanismOfAction', - 'nonProprietaryName', - 'overdosage', - 'pregnancyCategory', - 'pregnancyWarning', - 'prescribingInfo', - 'prescriptionStatus', - 'proprietaryName', - 'relatedDrug', - 'rxcui', - 'warning' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'activeIngredient' => ['Text'], - 'administrationRoute' => ['Text'], - 'alcoholWarning' => ['Text'], - 'availableStrength' => ['DrugStrength'], - 'breastfeedingWarning' => ['Text'], - 'clinicalPharmacology' => ['Text'], - 'dosageForm' => ['Text'], - 'doseSchedule' => ['DoseSchedule'], - 'drugClass' => ['DrugClass'], - 'drugUnit' => ['Text'], - 'foodWarning' => ['Text'], - 'includedInHealthInsurancePlan' => ['HealthInsurancePlan'], - 'interactingDrug' => ['Drug'], - 'isAvailableGenerically' => ['Boolean'], - 'isProprietary' => ['Boolean'], - 'labelDetails' => ['URL'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'manufacturer' => ['Organization'], - 'maximumIntake' => ['MaximumDoseSchedule'], - 'mechanismOfAction' => ['Text'], - 'nonProprietaryName' => ['Text'], - 'overdosage' => ['Text'], - 'pregnancyCategory' => ['DrugPregnancyCategory'], - 'pregnancyWarning' => ['Text'], - 'prescribingInfo' => ['URL'], - 'prescriptionStatus' => ['DrugPrescriptionStatus', 'Text'], - 'proprietaryName' => ['Text'], - 'relatedDrug' => ['Drug'], - 'rxcui' => ['Text'], - 'warning' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'activeIngredient' => 'An active ingredient, typically chemical compounds and/or biologic substances.', - 'administrationRoute' => 'A route by which this drug may be administered, e.g. \'oral\'.', - 'alcoholWarning' => 'Any precaution, guidance, contraindication, etc. related to consumption of alcohol while taking this drug.', - 'availableStrength' => 'An available dosage strength for the drug.', - 'breastfeedingWarning' => 'Any precaution, guidance, contraindication, etc. related to this drug\'s use by breastfeeding mothers.', - 'clinicalPharmacology' => 'Description of the absorption and elimination of drugs, including their concentration (pharmacokinetics, pK) and biological effects (pharmacodynamics, pD). Supersedes clincalPharmacology.', - 'dosageForm' => 'A dosage form in which this drug/supplement is available, e.g. \'tablet\', \'suspension\', \'injection\'.', - 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', - 'drugClass' => 'The class of drug this belongs to (e.g., statins).', - 'drugUnit' => 'The unit in which the drug is measured, e.g. \'5 mg tablet\'.', - 'foodWarning' => 'Any precaution, guidance, contraindication, etc. related to consumption of specific foods while taking this drug.', - 'includedInHealthInsurancePlan' => 'The insurance plans that cover this drug.', - 'interactingDrug' => 'Another drug that is known to interact with this drug in a way that impacts the effect of this drug or causes a risk to the patient. Note: disease interactions are typically captured as contraindications.', - 'isAvailableGenerically' => 'True if the drug is available in a generic form (regardless of name).', - 'isProprietary' => 'True if this item\'s name is a proprietary/brand name (vs. generic name).', - 'labelDetails' => 'Link to the drug\'s label details.', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'manufacturer' => 'The manufacturer of the product.', - 'maximumIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.', - 'mechanismOfAction' => 'The specific biochemical interaction through which this drug or supplement produces its pharmacological effect.', - 'nonProprietaryName' => 'The generic name of this drug or supplement.', - 'overdosage' => 'Any information related to overdose on a drug, including signs or symptoms, treatments, contact information for emergency response.', - 'pregnancyCategory' => 'Pregnancy category of this drug.', - 'pregnancyWarning' => 'Any precaution, guidance, contraindication, etc. related to this drug\'s use during pregnancy.', - 'prescribingInfo' => 'Link to prescribing information for the drug.', - 'prescriptionStatus' => 'Indicates the status of drug prescription eg. local catalogs classifications or whether the drug is available by prescription or over-the-counter, etc.', - 'proprietaryName' => 'Proprietary name given to the diet plan, typically by its originator or creator.', - 'relatedDrug' => 'Any other drug related to this one, for example commonly-prescribed alternatives.', - 'rxcui' => 'The RxCUI drug identifier from RXNORM.', - 'warning' => 'Any FDA or other warnings about the drug (text or URL).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An active ingredient, typically chemical compounds and/or biologic - * substances. - * - * @var string [schema.org types: Text] - */ - public $activeIngredient; - /** - * A route by which this drug may be administered, e.g. 'oral'. - * - * @var string [schema.org types: Text] - */ - public $administrationRoute; - /** - * Any precaution, guidance, contraindication, etc. related to consumption of - * alcohol while taking this drug. - * - * @var string [schema.org types: Text] - */ - public $alcoholWarning; - /** - * An available dosage strength for the drug. - * - * @var DrugStrength [schema.org types: DrugStrength] - */ - public $availableStrength; - /** - * Any precaution, guidance, contraindication, etc. related to this drug's use - * by breastfeeding mothers. - * - * @var string [schema.org types: Text] - */ - public $breastfeedingWarning; - /** - * Description of the absorption and elimination of drugs, including their - * concentration (pharmacokinetics, pK) and biological effects - * (pharmacodynamics, pD). Supersedes clincalPharmacology. - * - * @var string [schema.org types: Text] - */ - public $clinicalPharmacology; - /** - * A dosage form in which this drug/supplement is available, e.g. 'tablet', - * 'suspension', 'injection'. - * - * @var string [schema.org types: Text] - */ - public $dosageForm; - /** - * A dosing schedule for the drug for a given population, either observed, - * recommended, or maximum dose based on the type used. - * - * @var DoseSchedule [schema.org types: DoseSchedule] - */ - public $doseSchedule; - /** - * The class of drug this belongs to (e.g., statins). - * - * @var DrugClass [schema.org types: DrugClass] - */ - public $drugClass; - /** - * The unit in which the drug is measured, e.g. '5 mg tablet'. - * - * @var string [schema.org types: Text] - */ - public $drugUnit; /** - * Any precaution, guidance, contraindication, etc. related to consumption of - * specific foods while taking this drug. - * - * @var string [schema.org types: Text] - */ - public $foodWarning; - /** - * The insurance plans that cover this drug. - * - * @var HealthInsurancePlan [schema.org types: HealthInsurancePlan] - */ - public $includedInHealthInsurancePlan; - /** - * Another drug that is known to interact with this drug in a way that impacts - * the effect of this drug or causes a risk to the patient. Note: disease - * interactions are typically captured as contraindications. - * - * @var Drug [schema.org types: Drug] - */ - public $interactingDrug; - /** - * True if the drug is available in a generic form (regardless of name). - * - * @var bool [schema.org types: Boolean] - */ - public $isAvailableGenerically; - /** - * True if this item's name is a proprietary/brand name (vs. generic name). - * - * @var bool [schema.org types: Boolean] - */ - public $isProprietary; - /** - * Link to the drug's label details. - * - * @var string [schema.org types: URL] - */ - public $labelDetails; - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The manufacturer of the product. - * - * @var Organization [schema.org types: Organization] - */ - public $manufacturer; - /** - * Recommended intake of this supplement for a given population as defined by - * a specific recommending authority. - * - * @var MaximumDoseSchedule [schema.org types: MaximumDoseSchedule] - */ - public $maximumIntake; - /** - * The specific biochemical interaction through which this drug or supplement - * produces its pharmacological effect. - * - * @var string [schema.org types: Text] - */ - public $mechanismOfAction; - /** - * The generic name of this drug or supplement. - * - * @var string [schema.org types: Text] - */ - public $nonProprietaryName; - /** - * Any information related to overdose on a drug, including signs or symptoms, - * treatments, contact information for emergency response. - * - * @var string [schema.org types: Text] - */ - public $overdosage; - /** - * Pregnancy category of this drug. - * - * @var DrugPregnancyCategory [schema.org types: DrugPregnancyCategory] - */ - public $pregnancyCategory; - /** - * Any precaution, guidance, contraindication, etc. related to this drug's use - * during pregnancy. - * - * @var string [schema.org types: Text] - */ - public $pregnancyWarning; - /** - * Link to prescribing information for the drug. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $prescribingInfo; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'activeIngredient' => 'An active ingredient, typically chemical compounds and/or biologic substances.', + '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.', + 'administrationRoute' => 'A route by which this drug may be administered, e.g. \'oral\'.', + 'alcoholWarning' => 'Any precaution, guidance, contraindication, etc. related to consumption of alcohol while taking this drug.', + 'alternateName' => 'An alias for the item.', + 'availableStrength' => 'An available dosage strength for the drug.', + 'breastfeedingWarning' => 'Any precaution, guidance, contraindication, etc. related to this drug\'s use by breastfeeding mothers.', + 'clincalPharmacology' => 'Description of the absorption and elimination of drugs, including their concentration (pharmacokinetics, pK) and biological effects (pharmacodynamics, pD).', + 'clinicalPharmacology' => 'Description of the absorption and elimination of drugs, including their concentration (pharmacokinetics, pK) and biological effects (pharmacodynamics, pD).', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'dosageForm' => 'A dosage form in which this drug/supplement is available, e.g. \'tablet\', \'suspension\', \'injection\'.', + 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', + 'drugClass' => 'The class of drug this belongs to (e.g., statins).', + 'drugUnit' => 'The unit in which the drug is measured, e.g. \'5 mg tablet\'.', + 'foodWarning' => 'Any precaution, guidance, contraindication, etc. related to consumption of specific foods while taking this drug.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includedInHealthInsurancePlan' => 'The insurance plans that cover this drug.', + 'interactingDrug' => 'Another drug that is known to interact with this drug in a way that impacts the effect of this drug or causes a risk to the patient. Note: disease interactions are typically captured as contraindications.', + 'isAvailableGenerically' => 'True if the drug is available in a generic form (regardless of name).', + 'isProprietary' => 'True if this item\'s name is a proprietary/brand name (vs. generic name).', + 'labelDetails' => 'Link to the drug\'s label details.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'maximumIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.', + 'mechanismOfAction' => 'The specific biochemical interaction through which this drug or supplement produces its pharmacological effect.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'nonProprietaryName' => 'The generic name of this drug or supplement.', + 'overdosage' => 'Any information related to overdose on a drug, including signs or symptoms, treatments, contact information for emergency response.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'pregnancyCategory' => 'Pregnancy category of this drug.', + 'pregnancyWarning' => 'Any precaution, guidance, contraindication, etc. related to this drug\'s use during pregnancy.', + 'prescribingInfo' => 'Link to prescribing information for the drug.', + 'prescriptionStatus' => 'Indicates the status of drug prescription eg. local catalogs classifications or whether the drug is available by prescription or over-the-counter, etc.', + 'proprietaryName' => 'Proprietary name given to the diet plan, typically by its originator or creator.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedDrug' => 'Any other drug related to this one, for example commonly-prescribed alternatives.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'rxcui' => 'The RxCUI drug identifier from RXNORM.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'warning' => 'Any FDA or other warnings about the drug (text or URL).' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Indicates the status of drug prescription eg. local catalogs - * classifications or whether the drug is available by prescription or - * over-the-counter, etc. - * - * @var mixed|DrugPrescriptionStatus|string [schema.org types: DrugPrescriptionStatus, Text] - */ - public $prescriptionStatus; - /** - * Proprietary name given to the diet plan, typically by its originator or - * creator. - * - * @var string [schema.org types: Text] - */ - public $proprietaryName; /** - * Any other drug related to this one, for example commonly-prescribed - * alternatives. - * - * @var Drug [schema.org types: Drug] - */ - public $relatedDrug; - /** - * The RxCUI drug identifier from RXNORM. - * - * @var string [schema.org types: Text] - */ - public $rxcui; - /** - * Any FDA or other warnings about the drug (text or URL). - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $warning; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['activeIngredient', 'administrationRoute', 'alcoholWarning', 'availableStrength', 'breastfeedingWarning', 'clinicalPharmacology', 'dosageForm', 'doseSchedule', 'drugClass', 'drugUnit', 'foodWarning', 'includedInHealthInsurancePlan', 'interactingDrug', 'isAvailableGenerically', 'isProprietary', 'labelDetails', 'legalStatus', 'manufacturer', 'maximumIntake', 'mechanismOfAction', 'nonProprietaryName', 'overdosage', 'pregnancyCategory', 'pregnancyWarning', 'prescribingInfo', 'prescriptionStatus', 'proprietaryName', 'relatedDrug', 'rxcui', 'warning'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrugClass.php b/src/models/jsonld/DrugClass.php index 38b12090a..bd07cf803 100644 --- a/src/models/jsonld/DrugClass.php +++ b/src/models/jsonld/DrugClass.php @@ -1,29 +1,29 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'drug' => ['Drug'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'drug' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'drug' => ['Drug'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'drug' => 'Specifying a drug or medicine used in a medication procedure' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Specifying a drug or medicine used in a medication procedure - * - * @var Drug [schema.org types: Drug] + * @inheritdoc */ - public $drug; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['drug'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrugClassInterface.php b/src/models/jsonld/DrugClassInterface.php new file mode 100644 index 000000000..9ec665769 --- /dev/null +++ b/src/models/jsonld/DrugClassInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'applicableLocation' => ['AdministrativeArea'], + 'code' => ['MedicalCode'], + 'costCategory' => ['DrugCostCategory'], + 'costCurrency' => ['Text'], + 'costOrigin' => ['Text'], + 'costPerUnit' => ['Number', 'Text', 'QualitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'drugUnit' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'applicableLocation', - 'costCategory', - 'costCurrency', - 'costOrigin', - 'costPerUnit', - 'drugUnit' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'applicableLocation' => ['AdministrativeArea'], - 'costCategory' => ['DrugCostCategory'], - 'costCurrency' => ['Text'], - 'costOrigin' => ['Text'], - 'costPerUnit' => ['Number', 'QualitativeValue', 'Text'], - 'drugUnit' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'applicableLocation' => 'The location in which the status applies.', - 'costCategory' => 'The category of cost, such as wholesale, retail, reimbursement cap, etc.', - 'costCurrency' => 'The currency (in 3-letter of the drug cost. See: http://en.wikipedia.org/wiki/ISO_4217', - 'costOrigin' => 'Additional details to capture the origin of the cost data. For example, \'Medicare Part B\'.', - 'costPerUnit' => 'The cost per unit of the drug.', - 'drugUnit' => 'The unit in which the drug is measured, e.g. \'5 mg tablet\'.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The location in which the status applies. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] + * @inheritdoc */ - public $applicableLocation; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'applicableLocation' => 'The location in which the status applies.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'costCategory' => 'The category of cost, such as wholesale, retail, reimbursement cap, etc.', + 'costCurrency' => 'The currency (in 3-letter of the drug cost. See: http://en.wikipedia.org/wiki/ISO_4217. ', + 'costOrigin' => 'Additional details to capture the origin of the cost data. For example, \'Medicare Part B\'.', + 'costPerUnit' => 'The cost per unit of the drug.', + 'description' => 'A description of the item.', + '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.', + 'drugUnit' => 'The unit in which the drug is measured, e.g. \'5 mg tablet\'.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The category of cost, such as wholesale, retail, reimbursement cap, etc. - * - * @var DrugCostCategory [schema.org types: DrugCostCategory] - */ - public $costCategory; /** - * The currency (in 3-letter of the drug cost. See: - * http://en.wikipedia.org/wiki/ISO_4217 - * - * @var string [schema.org types: Text] - */ - public $costCurrency; - /** - * Additional details to capture the origin of the cost data. For example, - * 'Medicare Part B'. - * - * @var string [schema.org types: Text] - */ - public $costOrigin; - /** - * The cost per unit of the drug. - * - * @var mixed|float|QualitativeValue|string [schema.org types: Number, QualitativeValue, Text] - */ - public $costPerUnit; - /** - * The unit in which the drug is measured, e.g. '5 mg tablet'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $drugUnit; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['applicableLocation', 'costCategory', 'costCurrency', 'costOrigin', 'costPerUnit', 'drugUnit'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrugCostCategory.php b/src/models/jsonld/DrugCostCategory.php index 4bb4d5848..6ea23530b 100644 --- a/src/models/jsonld/DrugCostCategory.php +++ b/src/models/jsonld/DrugCostCategory.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrugCostCategoryInterface.php b/src/models/jsonld/DrugCostCategoryInterface.php new file mode 100644 index 000000000..cb80d8d74 --- /dev/null +++ b/src/models/jsonld/DrugCostCategoryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'applicableLocation' => ['AdministrativeArea'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'applicableLocation' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'applicableLocation' => 'The location in which the status applies.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'applicableLocation' => ['AdministrativeArea'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'applicableLocation' => 'The location in which the status applies.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The location in which the status applies. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] + * @inheritdoc */ - public $applicableLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['applicableLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrugLegalStatusInterface.php b/src/models/jsonld/DrugLegalStatusInterface.php new file mode 100644 index 000000000..c58d2e940 --- /dev/null +++ b/src/models/jsonld/DrugLegalStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrugPregnancyCategoryInterface.php b/src/models/jsonld/DrugPregnancyCategoryInterface.php new file mode 100644 index 000000000..aecd35203 --- /dev/null +++ b/src/models/jsonld/DrugPregnancyCategoryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrugPrescriptionStatusInterface.php b/src/models/jsonld/DrugPrescriptionStatusInterface.php new file mode 100644 index 000000000..7c75bd22a --- /dev/null +++ b/src/models/jsonld/DrugPrescriptionStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'activeIngredient' => ['Text'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'availableIn' => ['AdministrativeArea'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumIntake' => ['MaximumDoseSchedule'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'strengthUnit' => ['Text'], + 'strengthValue' => ['Number'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'activeIngredient', - 'availableIn', - 'maximumIntake', - 'strengthUnit', - 'strengthValue' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'activeIngredient' => ['Text'], - 'availableIn' => ['AdministrativeArea'], - 'maximumIntake' => ['MaximumDoseSchedule'], - 'strengthUnit' => ['Text'], - 'strengthValue' => ['Number'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'activeIngredient' => 'An active ingredient, typically chemical compounds and/or biologic substances.', - 'availableIn' => 'The location in which the strength is available.', - 'maximumIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.', - 'strengthUnit' => 'The units of an active ingredient\'s strength, e.g. mg.', - 'strengthValue' => 'The value of an active ingredient\'s strength, e.g. 325.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'activeIngredient' => 'An active ingredient, typically chemical compounds and/or biologic substances.', + '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.', + 'alternateName' => 'An alias for the item.', + 'availableIn' => 'The location in which the strength is available.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'maximumIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'strengthUnit' => 'The units of an active ingredient\'s strength, e.g. mg.', + 'strengthValue' => 'The value of an active ingredient\'s strength, e.g. 325.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * An active ingredient, typically chemical compounds and/or biologic - * substances. - * - * @var string [schema.org types: Text] - */ - public $activeIngredient; - /** - * The location in which the strength is available. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] - */ - public $availableIn; - /** - * Recommended intake of this supplement for a given population as defined by - * a specific recommending authority. - * - * @var MaximumDoseSchedule [schema.org types: MaximumDoseSchedule] - */ - public $maximumIntake; - /** - * The units of an active ingredient's strength, e.g. mg. - * - * @var string [schema.org types: Text] - */ - public $strengthUnit; - /** - * The value of an active ingredient's strength, e.g. 325. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $strengthValue; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['activeIngredient', 'availableIn', 'maximumIntake', 'strengthUnit', 'strengthValue'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DrugStrengthInterface.php b/src/models/jsonld/DrugStrengthInterface.php new file mode 100644 index 000000000..cebf7e8ca --- /dev/null +++ b/src/models/jsonld/DrugStrengthInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DryCleaningOrLaundryInterface.php b/src/models/jsonld/DryCleaningOrLaundryInterface.php new file mode 100644 index 000000000..26e2aa612 --- /dev/null +++ b/src/models/jsonld/DryCleaningOrLaundryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/DurationInterface.php b/src/models/jsonld/DurationInterface.php new file mode 100644 index 000000000..565965a9d --- /dev/null +++ b/src/models/jsonld/DurationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EBookInterface.php b/src/models/jsonld/EBookInterface.php new file mode 100644 index 000000000..cc12c8b5a --- /dev/null +++ b/src/models/jsonld/EBookInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EPReleaseInterface.php b/src/models/jsonld/EPReleaseInterface.php new file mode 100644 index 000000000..e519f7175 --- /dev/null +++ b/src/models/jsonld/EPReleaseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryA1Plus.php b/src/models/jsonld/EUEnergyEfficiencyCategoryA1Plus.php new file mode 100644 index 000000000..7bf90aede --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryA1Plus.php @@ -0,0 +1,152 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryA1PlusInterface.php b/src/models/jsonld/EUEnergyEfficiencyCategoryA1PlusInterface.php new file mode 100644 index 000000000..cb4a67e60 --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryA1PlusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryA2PlusInterface.php b/src/models/jsonld/EUEnergyEfficiencyCategoryA2PlusInterface.php new file mode 100644 index 000000000..78057fd3c --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryA2PlusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryA3PlusInterface.php b/src/models/jsonld/EUEnergyEfficiencyCategoryA3PlusInterface.php new file mode 100644 index 000000000..004ce91a7 --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryA3PlusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryBInterface.php b/src/models/jsonld/EUEnergyEfficiencyCategoryBInterface.php new file mode 100644 index 000000000..abf56f2c6 --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryBInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryCInterface.php b/src/models/jsonld/EUEnergyEfficiencyCategoryCInterface.php new file mode 100644 index 000000000..0e0fc8571 --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryCInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryDInterface.php b/src/models/jsonld/EUEnergyEfficiencyCategoryDInterface.php new file mode 100644 index 000000000..26d3180da --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryDInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryEInterface.php b/src/models/jsonld/EUEnergyEfficiencyCategoryEInterface.php new file mode 100644 index 000000000..b8eaf038e --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryEInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryFInterface.php b/src/models/jsonld/EUEnergyEfficiencyCategoryFInterface.php new file mode 100644 index 000000000..6938c9665 --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryFInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyCategoryGInterface.php b/src/models/jsonld/EUEnergyEfficiencyCategoryGInterface.php new file mode 100644 index 000000000..bdc7d81b0 --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyCategoryGInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EUEnergyEfficiencyEnumerationInterface.php b/src/models/jsonld/EUEnergyEfficiencyEnumerationInterface.php new file mode 100644 index 000000000..e408c9ca7 --- /dev/null +++ b/src/models/jsonld/EUEnergyEfficiencyEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EarInterface.php b/src/models/jsonld/EarInterface.php new file mode 100644 index 000000000..5db2b61bf --- /dev/null +++ b/src/models/jsonld/EarInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EatActionInterface.php b/src/models/jsonld/EatActionInterface.php new file mode 100644 index 000000000..e4f2fe16a --- /dev/null +++ b/src/models/jsonld/EatActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EditedOrCroppedContentInterface.php b/src/models/jsonld/EditedOrCroppedContentInterface.php new file mode 100644 index 000000000..43ecc767b --- /dev/null +++ b/src/models/jsonld/EditedOrCroppedContentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'teaches' => ['DefinedTerm', 'Text'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EducationEventInterface.php b/src/models/jsonld/EducationEventInterface.php new file mode 100644 index 000000000..3906fea8d --- /dev/null +++ b/src/models/jsonld/EducationEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'audienceType' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'educationalRole' => ['Text'], + 'geographicArea' => ['AdministrativeArea'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'educationalRole' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'audienceType' => 'The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).', + 'description' => 'A description of the item.', + '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.', + 'educationalRole' => 'An educationalRole of an EducationalAudience.', + 'geographicArea' => 'The geographic area associated with the audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'educationalRole' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'educationalRole' => 'An educationalRole of an EducationalAudience.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An educationalRole of an EducationalAudience. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $educationalRole; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['educationalRole'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EducationalAudienceInterface.php b/src/models/jsonld/EducationalAudienceInterface.php new file mode 100644 index 000000000..98217eb12 --- /dev/null +++ b/src/models/jsonld/EducationalAudienceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'competencyRequired' => ['Text', 'DefinedTerm', 'URL'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'credentialCategory' => ['URL', 'DefinedTerm', 'Text'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recognizedBy' => ['Organization'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'validFor' => ['Duration'], + 'validIn' => ['AdministrativeArea'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'competencyRequired', - 'credentialCategory', - 'educationalLevel', - 'recognizedBy', - 'validFor', - 'validIn' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'competencyRequired' => ['DefinedTerm', 'Text', 'URL'], - 'credentialCategory' => ['DefinedTerm', 'Text', 'URL'], - 'educationalLevel' => ['DefinedTerm', 'Text', 'URL'], - 'recognizedBy' => ['Organization'], - 'validFor' => ['Duration'], - 'validIn' => ['AdministrativeArea'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'competencyRequired' => 'Knowledge, skill, ability or personal attribute that must be demonstrated by a person or other entity.', - 'credentialCategory' => 'The category or type of credential being described, for example "degree”, “certificate”, “badge”, or more specific term.', - 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', - 'recognizedBy' => 'An organization that acknowledges the validity, value or utility of a credential. Note: recognition may include a process of quality assurance or accreditation.', - 'validFor' => 'The duration of validity of a permit or similar thing.', - 'validIn' => 'The geographic area where a permit or similar thing is valid.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * Knowledge, skill, ability or personal attribute that must be demonstrated - * by a person or other entity. - * - * @var mixed|DefinedTerm|string|string [schema.org types: DefinedTerm, Text, URL] + * @inheritdoc */ - public $competencyRequired; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'competencyRequired' => 'Knowledge, skill, ability or personal attribute that must be demonstrated by a person or other entity in order to do something such as earn an Educational Occupational Credential or understand a LearningResource.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'credentialCategory' => 'The category or type of credential being described, for example "degree”, “certificate”, “badge”, or more specific term.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recognizedBy' => 'An organization that acknowledges the validity, value or utility of a credential. Note: recognition may include a process of quality assurance or accreditation.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'validFor' => 'The duration of validity of a permit or similar thing.', + 'validIn' => 'The geographic area where a permit or similar thing is valid.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The category or type of credential being described, for example "degree”, - * “certificate”, “badge”, or more specific term. - * - * @var mixed|DefinedTerm|string|string [schema.org types: DefinedTerm, Text, URL] - */ - public $credentialCategory; /** - * The level in terms of progression through an educational or training - * context. Examples of educational levels include 'beginner', 'intermediate' - * or 'advanced', and formal sets of level indicators. - * - * @var mixed|DefinedTerm|string|string [schema.org types: DefinedTerm, Text, URL] - */ - public $educationalLevel; - /** - * An organization that acknowledges the validity, value or utility of a - * credential. Note: recognition may include a process of quality assurance or - * accreditation. - * - * @var Organization [schema.org types: Organization] - */ - public $recognizedBy; - /** - * The duration of validity of a permit or similar thing. - * - * @var Duration [schema.org types: Duration] - */ - public $validFor; - /** - * The geographic area where a permit or similar thing is valid. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] + * @inheritdoc */ - public $validIn; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['competencyRequired', 'credentialCategory', 'educationalLevel', 'recognizedBy', 'validFor', 'validIn'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EducationalOccupationalCredentialInterface.php b/src/models/jsonld/EducationalOccupationalCredentialInterface.php new file mode 100644 index 000000000..e1f780c6e --- /dev/null +++ b/src/models/jsonld/EducationalOccupationalCredentialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'applicationDeadline' => ['Date'], + 'applicationStartDate' => ['Date'], + 'dayOfWeek' => ['DayOfWeek'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'educationalCredentialAwarded' => ['URL', 'EducationalOccupationalCredential', 'Text'], + 'educationalProgramMode' => ['URL', 'Text'], + 'endDate' => ['Date', 'DateTime'], + 'financialAidEligible' => ['Text', 'DefinedTerm'], + 'hasCourse' => ['Course'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumEnrollment' => ['Integer'], + 'name' => ['Text'], + 'numberOfCredits' => ['Integer', 'StructuredValue'], + 'occupationalCategory' => ['CategoryCode', 'Text'], + 'occupationalCredentialAwarded' => ['EducationalOccupationalCredential', 'Text', 'URL'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'programPrerequisites' => ['AlignmentObject', 'Course', 'EducationalOccupationalCredential', 'Text'], + 'programType' => ['Text', 'DefinedTerm'], + 'provider' => ['Organization', 'Person'], + 'salaryUponCompletion' => ['MonetaryAmountDistribution'], + 'sameAs' => ['URL'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termDuration' => ['Duration'], + 'termsPerYear' => ['Number'], + 'timeOfDay' => ['Text'], + 'timeToComplete' => ['Duration'], + 'trainingSalary' => ['MonetaryAmountDistribution'], + 'typicalCreditsPerTerm' => ['Integer', 'StructuredValue'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'applicationDeadline', - 'applicationStartDate', - 'dayOfWeek', - 'educationalCredentialAwarded', - 'educationalProgramMode', - 'endDate', - 'financialAidEligible', - 'maximumEnrollment', - 'numberOfCredits', - 'occupationalCategory', - 'occupationalCredentialAwarded', - 'offers', - 'programPrerequisites', - 'programType', - 'provider', - 'salaryUponCompletion', - 'startDate', - 'termDuration', - 'termsPerYear', - 'timeOfDay', - 'timeToComplete', - 'trainingSalary', - 'typicalCreditsPerTerm' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'applicationDeadline' => ['Date'], - 'applicationStartDate' => ['Date'], - 'dayOfWeek' => ['DayOfWeek'], - 'educationalCredentialAwarded' => ['EducationalOccupationalCredential', 'Text', 'URL'], - 'educationalProgramMode' => ['Text', 'URL'], - 'endDate' => ['Date', 'DateTime'], - 'financialAidEligible' => ['DefinedTerm', 'Text'], - 'maximumEnrollment' => ['Integer'], - 'numberOfCredits' => ['Integer', 'StructuredValue'], - 'occupationalCategory' => ['CategoryCode', 'Text'], - 'occupationalCredentialAwarded' => ['EducationalOccupationalCredential', 'Text', 'URL'], - 'offers' => ['Demand', 'Offer'], - 'programPrerequisites' => ['AlignmentObject', 'Course', 'EducationalOccupationalCredential', 'Text'], - 'programType' => ['DefinedTerm', 'Text'], - 'provider' => ['Organization', 'Person'], - 'salaryUponCompletion' => ['MonetaryAmountDistribution'], - 'startDate' => ['Date', 'DateTime'], - 'termDuration' => ['Duration'], - 'termsPerYear' => ['Number'], - 'timeOfDay' => ['Text'], - 'timeToComplete' => ['Duration'], - 'trainingSalary' => ['MonetaryAmountDistribution'], - 'typicalCreditsPerTerm' => ['Integer', 'StructuredValue'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'applicationDeadline' => 'The date at which the program stops collecting applications for the next enrollment cycle.', - 'applicationStartDate' => 'The date at which the program begins collecting applications for the next enrollment cycle.', - 'dayOfWeek' => 'The day of the week for which these opening hours are valid.', - 'educationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other educational credential awarded as a consequence of successful completion of this course or program.', - 'educationalProgramMode' => 'Similar to courseMode, The medium or means of delivery of the program as a whole. The value may either be a text label (e.g. "online", "onsite" or "blended"; "synchronous" or "asynchronous"; "full-time" or "part-time") or a URL reference to a term from a controlled vocabulary (e.g. https://ceds.ed.gov/element/001311#Asynchronous ).', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'financialAidEligible' => 'A financial aid type or program which students may use to pay for tuition or fees associated with the program.', - 'maximumEnrollment' => 'The maximum number of students who may be enrolled in the program.', - 'numberOfCredits' => 'The number of credits or units awarded by a Course or required to complete an EducationalOccupationalProgram.', - 'occupationalCategory' => 'A category describing the job, preferably using a term from a taxonomy such as BLS O*NET-SOC, ISCO-08 or similar, with the property repeated for each applicable value. Ideally the taxonomy should be identified, and both the textual label and formal code for the category should be provided. Note: for historical reasons, any textual label and formal code provided as a literal may be assumed to be from O*NET-SOC.', - 'occupationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other occupational credential awarded as a consequence of successful completion of this course or program.', - '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. Inverse property: itemOffered.', - 'programPrerequisites' => 'Prerequisites for enrolling in the program.', - 'programType' => 'The type of educational or occupational program. For example, classroom, internship, alternance, etc..', - '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. Supersedes carrier.', - 'salaryUponCompletion' => 'The expected salary upon completing the training.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - 'termDuration' => 'The amount of time in a term as defined by the institution. A term is a length of time where students take one or more classes. Semesters and quarters are common units for term.', - 'termsPerYear' => 'The number of times terms of study are offered per year. Semesters and quarters are common units for term. For example, if the student can only take 2 semesters for the program in one year, then termsPerYear should be 2.', - 'timeOfDay' => 'The time of day the program normally runs. For example, "evenings".', - 'timeToComplete' => 'The expected length of time to complete the program if attending full-time.', - 'trainingSalary' => 'The estimated salary earned while in the program.', - 'typicalCreditsPerTerm' => 'The number of credits or units a full-time student would be expected to take in 1 term however \'term\' is defined by the institution.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The date at which the program stops collecting applications for the next - * enrollment cycle. - * - * @var Date [schema.org types: Date] - */ - public $applicationDeadline; - /** - * The date at which the program begins collecting applications for the next - * enrollment cycle. - * - * @var Date [schema.org types: Date] - */ - public $applicationStartDate; - /** - * The day of the week for which these opening hours are valid. - * - * @var DayOfWeek [schema.org types: DayOfWeek] - */ - public $dayOfWeek; - /** - * A description of the qualification, award, certificate, diploma or other - * educational credential awarded as a consequence of successful completion of - * this course or program. - * - * @var mixed|EducationalOccupationalCredential|string|string [schema.org types: EducationalOccupationalCredential, Text, URL] - */ - public $educationalCredentialAwarded; - /** - * Similar to courseMode, The medium or means of delivery of the program as a - * whole. The value may either be a text label (e.g. "online", "onsite" or - * "blended"; "synchronous" or "asynchronous"; "full-time" or "part-time") or - * a URL reference to a term from a controlled vocabulary (e.g. - * https://ceds.ed.gov/element/001311#Asynchronous ). - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $educationalProgramMode; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * A financial aid type or program which students may use to pay for tuition - * or fees associated with the program. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $financialAidEligible; - /** - * The maximum number of students who may be enrolled in the program. - * - * @var int [schema.org types: Integer] - */ - public $maximumEnrollment; - /** - * The number of credits or units awarded by a Course or required to complete - * an EducationalOccupationalProgram. - * - * @var mixed|int|StructuredValue [schema.org types: Integer, StructuredValue] - */ - public $numberOfCredits; - /** - * A category describing the job, preferably using a term from a taxonomy such - * as BLS O*NET-SOC, ISCO-08 or similar, with the property repeated for each - * applicable value. Ideally the taxonomy should be identified, and both the - * textual label and formal code for the category should be provided. Note: - * for historical reasons, any textual label and formal code provided as a - * literal may be assumed to be from O*NET-SOC. - * - * @var mixed|CategoryCode|string [schema.org types: CategoryCode, Text] - */ - public $occupationalCategory; - /** - * A description of the qualification, award, certificate, diploma or other - * occupational credential awarded as a consequence of successful completion - * of this course or program. - * - * @var mixed|EducationalOccupationalCredential|string|string [schema.org types: EducationalOccupationalCredential, Text, URL] - */ - public $occupationalCredentialAwarded; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * Prerequisites for enrolling in the program. - * - * @var mixed|AlignmentObject|Course|EducationalOccupationalCredential|string [schema.org types: AlignmentObject, Course, EducationalOccupationalCredential, Text] - */ - public $programPrerequisites; - /** - * The type of educational or occupational program. For example, classroom, - * internship, alternance, etc.. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $programType; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * The expected salary upon completing the training. - * - * @var MonetaryAmountDistribution [schema.org types: MonetaryAmountDistribution] - */ - public $salaryUponCompletion; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * The amount of time in a term as defined by the institution. A term is a - * length of time where students take one or more classes. Semesters and - * quarters are common units for term. - * - * @var Duration [schema.org types: Duration] + * @inheritdoc */ - public $termDuration; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'applicationDeadline' => 'The date at which the program stops collecting applications for the next enrollment cycle.', + 'applicationStartDate' => 'The date at which the program begins collecting applications for the next enrollment cycle.', + 'dayOfWeek' => 'The day of the week for which these opening hours are valid.', + 'description' => 'A description of the item.', + '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.', + 'educationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other educational credential awarded as a consequence of successful completion of this course or program.', + 'educationalProgramMode' => 'Similar to courseMode, The medium or means of delivery of the program as a whole. The value may either be a text label (e.g. "online", "onsite" or "blended"; "synchronous" or "asynchronous"; "full-time" or "part-time") or a URL reference to a term from a controlled vocabulary (e.g. https://ceds.ed.gov/element/001311#Asynchronous ).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'financialAidEligible' => 'A financial aid type or program which students may use to pay for tuition or fees associated with the program.', + 'hasCourse' => 'A course or class that is one of the learning opportunities that constitute an educational / occupational program. No information is implied about whether the course is mandatory or optional; no guarantee is implied about whether the course will be available to everyone on the program.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maximumEnrollment' => 'The maximum number of students who may be enrolled in the program.', + 'name' => 'The name of the item.', + 'numberOfCredits' => 'The number of credits or units awarded by a Course or required to complete an EducationalOccupationalProgram.', + 'occupationalCategory' => 'A category describing the job, preferably using a term from a taxonomy such as [BLS O*NET-SOC](http://www.onetcenter.org/taxonomy.html), [ISCO-08](https://www.ilo.org/public/english/bureau/stat/isco/isco08/) or similar, with the property repeated for each applicable value. Ideally the taxonomy should be identified, and both the textual label and formal code for the category should be provided. Note: for historical reasons, any textual label and formal code provided as a literal may be assumed to be from O*NET-SOC.', + 'occupationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other occupational credential awarded as a consequence of successful completion of this course or program.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'programPrerequisites' => 'Prerequisites for enrolling in the program.', + 'programType' => 'The type of educational or occupational program. For example, classroom, internship, alternance, etc..', + '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.', + 'salaryUponCompletion' => 'The expected salary upon completing the training.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termDuration' => 'The amount of time in a term as defined by the institution. A term is a length of time where students take one or more classes. Semesters and quarters are common units for term.', + 'termsPerYear' => 'The number of times terms of study are offered per year. Semesters and quarters are common units for term. For example, if the student can only take 2 semesters for the program in one year, then termsPerYear should be 2.', + 'timeOfDay' => 'The time of day the program normally runs. For example, "evenings".', + 'timeToComplete' => 'The expected length of time to complete the program if attending full-time.', + 'trainingSalary' => 'The estimated salary earned while in the program.', + 'typicalCreditsPerTerm' => 'The number of credits or units a full-time student would be expected to take in 1 term however \'term\' is defined by the institution.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The number of times terms of study are offered per year. Semesters and - * quarters are common units for term. For example, if the student can only - * take 2 semesters for the program in one year, then termsPerYear should be - * 2. - * - * @var float [schema.org types: Number] - */ - public $termsPerYear; - /** - * The time of day the program normally runs. For example, "evenings". - * - * @var string [schema.org types: Text] - */ - public $timeOfDay; - /** - * The expected length of time to complete the program if attending full-time. - * - * @var Duration [schema.org types: Duration] - */ - public $timeToComplete; - /** - * The estimated salary earned while in the program. - * - * @var MonetaryAmountDistribution [schema.org types: MonetaryAmountDistribution] - */ - public $trainingSalary; - /** - * The number of credits or units a full-time student would be expected to - * take in 1 term however 'term' is defined by the institution. - * - * @var mixed|int|StructuredValue [schema.org types: Integer, StructuredValue] + * @inheritdoc */ - public $typicalCreditsPerTerm; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['applicationDeadline', 'applicationStartDate', 'dayOfWeek', 'educationalCredentialAwarded', 'educationalProgramMode', 'endDate', 'financialAidEligible', 'maximumEnrollment', 'numberOfCredits', 'occupationalCategory', 'occupationalCredentialAwarded', 'offers', 'programPrerequisites', 'programType', 'provider', 'salaryUponCompletion', 'startDate', 'termDuration', 'termsPerYear', 'timeOfDay', 'timeToComplete', 'trainingSalary', 'typicalCreditsPerTerm'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EducationalOccupationalProgramInterface.php b/src/models/jsonld/EducationalOccupationalProgramInterface.php new file mode 100644 index 000000000..45f25317a --- /dev/null +++ b/src/models/jsonld/EducationalOccupationalProgramInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'alumni' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'alumni' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $alumni; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['alumni'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EducationalOrganizationInterface.php b/src/models/jsonld/EducationalOrganizationInterface.php new file mode 100644 index 000000000..569be67ac --- /dev/null +++ b/src/models/jsonld/EducationalOrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EffectivenessHealthAspectInterface.php b/src/models/jsonld/EffectivenessHealthAspectInterface.php new file mode 100644 index 000000000..ab6f2d3b4 --- /dev/null +++ b/src/models/jsonld/EffectivenessHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ElectricianInterface.php b/src/models/jsonld/ElectricianInterface.php new file mode 100644 index 000000000..f173d7d2f --- /dev/null +++ b/src/models/jsonld/ElectricianInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ElectronicsStoreInterface.php b/src/models/jsonld/ElectronicsStoreInterface.php new file mode 100644 index 000000000..1e28b26fd --- /dev/null +++ b/src/models/jsonld/ElectronicsStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'alumni' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'alumni' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $alumni; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['alumni'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ElementarySchoolInterface.php b/src/models/jsonld/ElementarySchoolInterface.php new file mode 100644 index 000000000..498cd9aa7 --- /dev/null +++ b/src/models/jsonld/ElementarySchoolInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bccRecipient' => ['Person', 'ContactPoint', 'Organization'], + 'ccRecipient' => ['Person', 'Organization', 'ContactPoint'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dateRead' => ['Date', 'DateTime'], + 'dateReceived' => ['DateTime'], + 'dateSent' => ['DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'messageAttachment' => ['CreativeWork'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sender' => ['Person', 'Audience', 'Organization'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'toRecipient' => ['ContactPoint', 'Person', 'Audience', 'Organization'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bccRecipient', - 'ccRecipient', - 'dateRead', - 'dateReceived', - 'dateSent', - 'messageAttachment', - 'recipient', - 'sender', - 'toRecipient' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bccRecipient' => ['ContactPoint', 'Organization', 'Person'], - 'ccRecipient' => ['ContactPoint', 'Organization', 'Person'], - 'dateRead' => ['Date', 'DateTime'], - 'dateReceived' => ['DateTime'], - 'dateSent' => ['DateTime'], - 'messageAttachment' => ['CreativeWork'], - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'], - 'sender' => ['Audience', 'Organization', 'Person'], - 'toRecipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bccRecipient' => 'A sub property of recipient. The recipient blind copied on a message.', - 'ccRecipient' => 'A sub property of recipient. The recipient copied on a message.', - 'dateRead' => 'The date/time at which the message has been read by the recipient if a single recipient exists.', - 'dateReceived' => 'The date/time the message was received if a single recipient exists.', - 'dateSent' => 'The date/time at which the message was sent.', - 'messageAttachment' => 'A CreativeWork attached to the message.', - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', - 'sender' => 'A sub property of participant. The participant who is at the sending end of the action.', - 'toRecipient' => 'A sub property of recipient. The recipient who was directly sent the message.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of recipient. The recipient blind copied on a message. - * - * @var mixed|ContactPoint|Organization|Person [schema.org types: ContactPoint, Organization, Person] - */ - public $bccRecipient; - /** - * A sub property of recipient. The recipient copied on a message. - * - * @var mixed|ContactPoint|Organization|Person [schema.org types: ContactPoint, Organization, Person] - */ - public $ccRecipient; - /** - * The date/time at which the message has been read by the recipient if a - * single recipient exists. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateRead; - /** - * The date/time the message was received if a single recipient exists. - * - * @var DateTime [schema.org types: DateTime] + * @inheritdoc */ - public $dateReceived; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bccRecipient' => 'A sub property of recipient. The recipient blind copied on a message.', + 'ccRecipient' => 'A sub property of recipient. The recipient copied on a message.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dateRead' => 'The date/time at which the message has been read by the recipient if a single recipient exists.', + 'dateReceived' => 'The date/time the message was received if a single recipient exists.', + 'dateSent' => 'The date/time at which the message was sent.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'messageAttachment' => 'A CreativeWork attached to the message.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sender' => 'A sub property of participant. The participant who is at the sending end of the action.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'toRecipient' => 'A sub property of recipient. The recipient who was directly sent the message.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The date/time at which the message was sent. - * - * @var DateTime [schema.org types: DateTime] - */ - public $dateSent; - /** - * A CreativeWork attached to the message. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $messageAttachment; - /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] - */ - public $recipient; - /** - * A sub property of participant. The participant who is at the sending end of - * the action. - * - * @var mixed|Audience|Organization|Person [schema.org types: Audience, Organization, Person] - */ - public $sender; - /** - * A sub property of recipient. The recipient who was directly sent the - * message. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $toRecipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bccRecipient', 'ccRecipient', 'dateRead', 'dateReceived', 'dateSent', 'messageAttachment', 'recipient', 'sender', 'toRecipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EmailMessageInterface.php b/src/models/jsonld/EmailMessageInterface.php new file mode 100644 index 000000000..09f20bb55 --- /dev/null +++ b/src/models/jsonld/EmailMessageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EmbassyInterface.php b/src/models/jsonld/EmbassyInterface.php new file mode 100644 index 000000000..44ddcc812 --- /dev/null +++ b/src/models/jsonld/EmbassyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EmergencyInterface.php b/src/models/jsonld/EmergencyInterface.php new file mode 100644 index 000000000..10394002f --- /dev/null +++ b/src/models/jsonld/EmergencyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EmergencyServiceInterface.php b/src/models/jsonld/EmergencyServiceInterface.php new file mode 100644 index 000000000..1c07b05f3 --- /dev/null +++ b/src/models/jsonld/EmergencyServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'baseSalary' => ['Number', 'PriceSpecification', 'MonetaryAmount'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endDate' => ['Date', 'DateTime'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'namedPosition' => ['Text', 'URL'], + 'numberedPosition' => ['Number'], + 'potentialAction' => ['Action'], + 'roleName' => ['URL', 'Text'], + 'salaryCurrency' => ['Text'], + 'sameAs' => ['URL'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'baseSalary', - 'salaryCurrency' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'baseSalary' => ['MonetaryAmount', 'Number', 'PriceSpecification'], - 'salaryCurrency' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'baseSalary' => 'The base salary of the job or of an employee in an EmployeeRole.', + 'description' => 'A description of the item.', + '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.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'namedPosition' => 'A position played, performed or filled by a person or organization, as part of an organization. For example, an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + 'numberedPosition' => 'A number associated with a role in an organization, for example, the number on an athlete\'s jersey.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'roleName' => 'A role played, performed or filled by a person or organization. For example, the team of creators for a comic book might fill the roles named \'inker\', \'penciller\', and \'letterer\'; or an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + 'salaryCurrency' => 'The currency (coded using [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) ) used for the main salary information in this job posting or for this employee.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'baseSalary' => 'The base salary of the job or of an employee in an EmployeeRole.', - 'salaryCurrency' => 'The currency (coded using ISO 4217 ) used for the main salary information in this job posting or for this employee.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The base salary of the job or of an employee in an EmployeeRole. - * - * @var mixed|MonetaryAmount|float|PriceSpecification [schema.org types: MonetaryAmount, Number, PriceSpecification] - */ - public $baseSalary; - /** - * The currency (coded using ISO 4217 ) used for the main salary information - * in this job posting or for this employee. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $salaryCurrency; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['baseSalary', 'salaryCurrency'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EmployeeRoleInterface.php b/src/models/jsonld/EmployeeRoleInterface.php new file mode 100644 index 000000000..011ef5514 --- /dev/null +++ b/src/models/jsonld/EmployeeRoleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'author' => ['Person', 'Organization'], + 'bestRating' => ['Text', 'Number'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itemReviewed' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'ratingCount' => ['Integer'], + 'ratingExplanation' => ['Text'], + 'ratingValue' => ['Number', 'Text'], + 'reviewAspect' => ['Text'], + 'reviewCount' => ['Integer'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'worstRating' => ['Text', 'Number'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemReviewed', - 'ratingCount', - 'reviewCount' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemReviewed' => ['Thing'], - 'ratingCount' => ['Integer'], - 'reviewCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'itemReviewed' => 'The item that is being reviewed/rated.', - 'ratingCount' => 'The count of total number of ratings.', - 'reviewCount' => 'The count of total number of reviews.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'bestRating' => 'The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'ratingCount' => 'The count of total number of ratings.', + 'ratingExplanation' => 'A short explanation (e.g. one to two sentences) providing background context and other information that led to the conclusion expressed in the rating. This is particularly applicable to ratings associated with "fact check" markup using [[ClaimReview]].', + 'ratingValue' => 'The rating for the content. Usage guidelines: * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewCount' => 'The count of total number of reviews.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'worstRating' => 'The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The item that is being reviewed/rated. - * - * @var Thing [schema.org types: Thing] - */ - public $itemReviewed; - /** - * The count of total number of ratings. - * - * @var int [schema.org types: Integer] - */ - public $ratingCount; /** - * The count of total number of reviews. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $reviewCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemReviewed', 'ratingCount', 'reviewCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EmployerAggregateRatingInterface.php b/src/models/jsonld/EmployerAggregateRatingInterface.php new file mode 100644 index 000000000..9091d1304 --- /dev/null +++ b/src/models/jsonld/EmployerAggregateRatingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedClaimReview' => ['Review'], + 'associatedMedia' => ['MediaObject'], + 'associatedMediaReview' => ['Review'], + 'associatedReview' => ['Review'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'itemReviewed' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'negativeNotes' => ['ListItem', 'Text', 'WebContent', 'ItemList'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'positiveNotes' => ['WebContent', 'Text', 'ListItem', 'ItemList'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewAspect' => ['Text'], + 'reviewBody' => ['Text'], + 'reviewRating' => ['Rating'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemReviewed', - 'reviewAspect', - 'reviewBody', - 'reviewRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemReviewed' => ['Thing'], - 'reviewAspect' => ['Text'], - 'reviewBody' => ['Text'], - 'reviewRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'itemReviewed' => 'The item that is being reviewed/rated.', - 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', - 'reviewBody' => 'The actual body of the review.', - 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The reviewRating applies to rating given by the review. The aggregateRating property applies to the review itself, as a creative work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedClaimReview' => 'An associated [[ClaimReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'associatedMediaReview' => 'An associated [[MediaReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedReview' => 'An associated [[Review]].', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'negativeNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), negative considerations - either as unstructured text, or a list.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'positiveNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), positive considerations - either as unstructured text, or a list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewBody' => 'The actual body of the review.', + 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating``` applies to rating given by the review. The [[aggregateRating]] property applies to the review itself, as a creative work.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The item that is being reviewed/rated. - * - * @var Thing [schema.org types: Thing] - */ - public $itemReviewed; - /** - * This Review or Rating is relevant to this part or facet of the - * itemReviewed. - * - * @var string [schema.org types: Text] - */ - public $reviewAspect; - /** - * The actual body of the review. - * - * @var string [schema.org types: Text] - */ - public $reviewBody; /** - * The rating given in this review. Note that reviews can themselves be rated. - * The reviewRating applies to rating given by the review. The aggregateRating - * property applies to the review itself, as a creative work. - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $reviewRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemReviewed', 'reviewAspect', 'reviewBody', 'reviewRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EmployerReviewInterface.php b/src/models/jsonld/EmployerReviewInterface.php new file mode 100644 index 000000000..e973e4e76 --- /dev/null +++ b/src/models/jsonld/EmployerReviewInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EmploymentAgencyInterface.php b/src/models/jsonld/EmploymentAgencyInterface.php new file mode 100644 index 000000000..7ca3402b8 --- /dev/null +++ b/src/models/jsonld/EmploymentAgencyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EndocrineInterface.php b/src/models/jsonld/EndocrineInterface.php new file mode 100644 index 000000000..e9c4531cb --- /dev/null +++ b/src/models/jsonld/EndocrineInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'endorsee' => ['Person', 'Organization'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'endorsee' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'endorsee' => 'A sub property of participant. The person/organization being supported.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'endorsee' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'endorsee' => 'A sub property of participant. The person/organization being supported.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The person/organization being supported. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $endorsee; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['endorsee'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EndorseActionInterface.php b/src/models/jsonld/EndorseActionInterface.php new file mode 100644 index 000000000..25b25f79c --- /dev/null +++ b/src/models/jsonld/EndorseActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'author' => ['Person', 'Organization'], + 'bestRating' => ['Text', 'Number'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'ratingExplanation' => ['Text'], + 'ratingValue' => ['Number', 'Text'], + 'reviewAspect' => ['Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'worstRating' => ['Text', 'Number'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'author', - 'bestRating', - 'ratingExplanation', - 'ratingValue', - 'reviewAspect', - 'worstRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'author' => ['Organization', 'Person'], - 'bestRating' => ['Number', 'Text'], - 'ratingExplanation' => ['Text'], - 'ratingValue' => ['Number', 'Text'], - 'reviewAspect' => ['Text'], - 'worstRating' => ['Number', 'Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'bestRating' => 'The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed.', - 'ratingExplanation' => 'A short explanation (e.g. one to two sentences) providing background context and other information that led to the conclusion expressed in the rating. This is particularly applicable to ratings associated with "fact check" markup using ClaimReview.', - 'ratingValue' => 'The rating for the content. Usage guidelines: Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', - 'worstRating' => 'The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $author; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'bestRating' => 'The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'ratingExplanation' => 'A short explanation (e.g. one to two sentences) providing background context and other information that led to the conclusion expressed in the rating. This is particularly applicable to ratings associated with "fact check" markup using [[ClaimReview]].', + 'ratingValue' => 'The rating for the content. Usage guidelines: * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'worstRating' => 'The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The highest value allowed in this rating system. If bestRating is omitted, - * 5 is assumed. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $bestRating; - /** - * A short explanation (e.g. one to two sentences) providing background - * context and other information that led to the conclusion expressed in the - * rating. This is particularly applicable to ratings associated with "fact - * check" markup using ClaimReview. - * - * @var string [schema.org types: Text] - */ - public $ratingExplanation; /** - * The rating for the content. Usage guidelines: Use values from 0123456789 - * (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than - * superficially similiar Unicode symbols. Use '.' (Unicode 'FULL STOP' - * (U+002E)) rather than ',' to indicate a decimal point. Avoid using these - * symbols as a readability separator. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $ratingValue; - /** - * This Review or Rating is relevant to this part or facet of the - * itemReviewed. - * - * @var string [schema.org types: Text] - */ - public $reviewAspect; - /** - * The lowest value allowed in this rating system. If worstRating is omitted, - * 1 is assumed. - * - * @var mixed|float|string [schema.org types: Number, Text] + * @inheritdoc */ - public $worstRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['author', 'bestRating', 'ratingExplanation', 'ratingValue', 'reviewAspect', 'worstRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EndorsementRatingInterface.php b/src/models/jsonld/EndorsementRatingInterface.php new file mode 100644 index 000000000..666d920bb --- /dev/null +++ b/src/models/jsonld/EndorsementRatingInterface.php @@ -0,0 +1,24 @@ + - * '. + * schema.org version: v14.0-release + * Energy - Properties that take Energy as values are of the form ' '. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Energy + * @see https://schema.org/Energy */ -class Energy extends Quantity +class Energy extends MetaJsonLd implements EnergyInterface, QuantityInterface, IntangibleInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -32,274 +32,115 @@ class Energy extends Quantity * * @var string */ - static public $schemaTypeName = 'Energy'; + static public string $schemaTypeName = 'Energy'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Energy'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'Properties that take Energy as values are of the form \' \'.'; + static public string $schemaTypeScope = 'https://schema.org/Energy'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Quantity'; + static public string $schemaTypeExtends = 'Quantity'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = << '. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use EnergyTrait; + use QuantityTrait; + use IntangibleTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EnergyConsumptionDetails.php b/src/models/jsonld/EnergyConsumptionDetails.php new file mode 100644 index 000000000..6971ab32a --- /dev/null +++ b/src/models/jsonld/EnergyConsumptionDetails.php @@ -0,0 +1,158 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'energyEfficiencyScaleMax' => ['EUEnergyEfficiencyEnumeration'], + 'energyEfficiencyScaleMin' => ['EUEnergyEfficiencyEnumeration'], + 'hasEnergyEfficiencyCategory' => ['EnergyEfficiencyEnumeration'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'energyEfficiencyScaleMax' => 'Specifies the most energy efficient class on the regulated EU energy consumption scale for the product category a product belongs to. For example, energy consumption for televisions placed on the market after January 1, 2020 is scaled from D to A+++.', + 'energyEfficiencyScaleMin' => 'Specifies the least energy efficient class on the regulated EU energy consumption scale for the product category a product belongs to. For example, energy consumption for televisions placed on the market after January 1, 2020 is scaled from D to A+++.', + 'hasEnergyEfficiencyCategory' => 'Defines the energy efficiency Category (which could be either a rating out of range of values or a yes/no certification) for a product according to an international energy efficiency standard.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EnergyConsumptionDetailsInterface.php b/src/models/jsonld/EnergyConsumptionDetailsInterface.php new file mode 100644 index 000000000..b1ade0bff --- /dev/null +++ b/src/models/jsonld/EnergyConsumptionDetailsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EnergyEfficiencyEnumerationInterface.php b/src/models/jsonld/EnergyEfficiencyEnumerationInterface.php new file mode 100644 index 000000000..be25610ce --- /dev/null +++ b/src/models/jsonld/EnergyEfficiencyEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EnergyStarCertifiedInterface.php b/src/models/jsonld/EnergyStarCertifiedInterface.php new file mode 100644 index 000000000..bd68bc40c --- /dev/null +++ b/src/models/jsonld/EnergyStarCertifiedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/EnergyStarEnergyEfficiencyEnumerationInterface.php b/src/models/jsonld/EnergyStarEnergyEfficiencyEnumerationInterface.php new file mode 100644 index 000000000..c10ab621f --- /dev/null +++ b/src/models/jsonld/EnergyStarEnergyEfficiencyEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'engineDisplacement' => ['QuantitativeValue'], + 'enginePower' => ['QuantitativeValue'], + 'engineType' => ['QualitativeValue', 'URL', 'Text'], + 'fuelType' => ['Text', 'URL', 'QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'torque' => ['QuantitativeValue'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'engineDisplacement', - 'enginePower', - 'engineType', - 'fuelType', - 'torque' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'engineDisplacement' => ['QuantitativeValue'], - 'enginePower' => ['QuantitativeValue'], - 'engineType' => ['QualitativeValue', 'Text', 'URL'], - 'fuelType' => ['QualitativeValue', 'Text', 'URL'], - 'torque' => ['QuantitativeValue'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'engineDisplacement' => 'The volume swept by all of the pistons inside the cylinders of an internal combustion engine in a single movement. Typical unit code(s): CMQ for cubic centimeter, LTR for liters, INQ for cubic inches * Note 1: You can link to information about how the given value has been determined using the valueReference property. * Note 2: You can use minValue and maxValue to indicate ranges.', - 'enginePower' => 'The power of the vehicle\'s engine. Typical unit code(s): KWT for kilowatt, BHP for brake horsepower, N12 for metric horsepower (PS, with 1 PS = 735,49875 W) Note 1: There are many different ways of measuring an engine\'s power. For an overview, see http://en.wikipedia.org/wiki/Horsepower#Enginepowertest_codes. Note 2: You can link to information about how the given value has been determined using the valueReference property. Note 3: You can use minValue and maxValue to indicate ranges.', - 'engineType' => 'The type of engine or engines powering the vehicle.', - 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', - 'torque' => 'The torque (turning force) of the vehicle\'s engine. Typical unit code(s): NU for newton metre (N m), F17 for pound-force per foot, or F48 for pound-force per inch Note 1: You can link to information about how the given value has been determined (e.g. reference RPM) using the valueReference property. Note 2: You can use minValue and maxValue to indicate ranges.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'engineDisplacement' => 'The volume swept by all of the pistons inside the cylinders of an internal combustion engine in a single movement. Typical unit code(s): CMQ for cubic centimeter, LTR for liters, INQ for cubic inches * Note 1: You can link to information about how the given value has been determined using the [[valueReference]] property. * Note 2: You can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'enginePower' => 'The power of the vehicle\'s engine. Typical unit code(s): KWT for kilowatt, BHP for brake horsepower, N12 for metric horsepower (PS, with 1 PS = 735,49875 W) * Note 1: There are many different ways of measuring an engine\'s power. For an overview, see [http://en.wikipedia.org/wiki/Horsepower#Engine_power_test_codes](http://en.wikipedia.org/wiki/Horsepower#Engine_power_test_codes). * Note 2: You can link to information about how the given value has been determined using the [[valueReference]] property. * Note 3: You can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'engineType' => 'The type of engine or engines powering the vehicle.', + 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'torque' => 'The torque (turning force) of the vehicle\'s engine. Typical unit code(s): NU for newton metre (N m), F17 for pound-force per foot, or F48 for pound-force per inch * Note 1: You can link to information about how the given value has been determined (e.g. reference RPM) using the [[valueReference]] property. * Note 2: You can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The volume swept by all of the pistons inside the cylinders of an internal - * combustion engine in a single movement. Typical unit code(s): CMQ for cubic - * centimeter, LTR for liters, INQ for cubic inches * Note 1: You can link to - * information about how the given value has been determined using the - * valueReference property. * Note 2: You can use minValue and maxValue to - * indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $engineDisplacement; - /** - * The power of the vehicle's engine. Typical unit code(s): KWT for kilowatt, - * BHP for brake horsepower, N12 for metric horsepower (PS, with 1 PS = - * 735,49875 W) Note 1: There are many different ways of measuring an engine's - * power. For an overview, see - * http://en.wikipedia.org/wiki/Horsepower#Enginepowertest_codes. Note 2: You - * can link to information about how the given value has been determined using - * the valueReference property. Note 3: You can use minValue and maxValue to - * indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $enginePower; - /** - * The type of engine or engines powering the vehicle. - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $engineType; - /** - * The type of fuel suitable for the engine or engines of the vehicle. If the - * vehicle has only one engine, this property can be attached directly to the - * vehicle. - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $fuelType; - /** - * The torque (turning force) of the vehicle's engine. Typical unit code(s): - * NU for newton metre (N m), F17 for pound-force per foot, or F48 for - * pound-force per inch Note 1: You can link to information about how the - * given value has been determined (e.g. reference RPM) using the - * valueReference property. Note 2: You can use minValue and maxValue to - * indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $torque; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['engineDisplacement', 'enginePower', 'engineType', 'fuelType', 'torque'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EngineSpecificationInterface.php b/src/models/jsonld/EngineSpecificationInterface.php new file mode 100644 index 000000000..12a2051b6 --- /dev/null +++ b/src/models/jsonld/EngineSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EnrollingByInvitationInterface.php b/src/models/jsonld/EnrollingByInvitationInterface.php new file mode 100644 index 000000000..e4177ce0c --- /dev/null +++ b/src/models/jsonld/EnrollingByInvitationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EntertainmentBusinessInterface.php b/src/models/jsonld/EntertainmentBusinessInterface.php new file mode 100644 index 000000000..cf69a30ba --- /dev/null +++ b/src/models/jsonld/EntertainmentBusinessInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionApplication' => ['SoftwareApplication'], + 'actionPlatform' => ['Text', 'URL', 'DigitalPlatformEnumeration'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'application' => ['SoftwareApplication'], + 'contentType' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'encodingType' => ['Text'], + 'httpMethod' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'urlTemplate' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionApplication', - 'actionPlatform', - 'contentType', - 'encodingType', - 'httpMethod', - 'urlTemplate' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionApplication' => ['SoftwareApplication'], - 'actionPlatform' => ['Text', 'URL'], - 'contentType' => ['Text'], - 'encodingType' => ['Text'], - 'httpMethod' => ['Text'], - 'urlTemplate' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionApplication' => 'An application that can complete the request. Supersedes application.', - 'actionPlatform' => 'The high level platform(s) where the Action can be performed for the given URL. To specify a specific application or operating system instance, use actionApplication.', - 'contentType' => 'The supported content type(s) for an EntryPoint response.', - 'encodingType' => 'The supported encoding type(s) for an EntryPoint request.', - 'httpMethod' => 'An HTTP method that specifies the appropriate HTTP method for a request to an HTTP EntryPoint. Values are capitalized strings as used in HTTP.', - 'urlTemplate' => 'An url template (RFC6570) that will be used to construct the target of the execution of the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * An application that can complete the request. Supersedes application. - * - * @var SoftwareApplication [schema.org types: SoftwareApplication] + * @inheritdoc */ - public $actionApplication; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionApplication' => 'An application that can complete the request.', + 'actionPlatform' => 'The high level platform(s) where the Action can be performed for the given URL. To specify a specific application or operating system instance, use actionApplication.', + '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.', + 'alternateName' => 'An alias for the item.', + 'application' => 'An application that can complete the request.', + 'contentType' => 'The supported content type(s) for an EntryPoint response.', + 'description' => 'A description of the item.', + '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.', + 'encodingType' => 'The supported encoding type(s) for an EntryPoint request.', + 'httpMethod' => 'An HTTP method that specifies the appropriate HTTP method for a request to an HTTP EntryPoint. Values are capitalized strings as used in HTTP.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'urlTemplate' => 'An url template (RFC6570) that will be used to construct the target of the execution of the action.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The high level platform(s) where the Action can be performed for the given - * URL. To specify a specific application or operating system instance, use - * actionApplication. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $actionPlatform; /** - * The supported content type(s) for an EntryPoint response. - * - * @var string [schema.org types: Text] - */ - public $contentType; - /** - * The supported encoding type(s) for an EntryPoint request. - * - * @var string [schema.org types: Text] - */ - public $encodingType; - /** - * An HTTP method that specifies the appropriate HTTP method for a request to - * an HTTP EntryPoint. Values are capitalized strings as used in HTTP. - * - * @var string [schema.org types: Text] - */ - public $httpMethod; - /** - * An url template (RFC6570) that will be used to construct the target of the - * execution of the action. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $urlTemplate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionApplication', 'actionPlatform', 'contentType', 'encodingType', 'httpMethod', 'urlTemplate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EntryPointInterface.php b/src/models/jsonld/EntryPointInterface.php new file mode 100644 index 000000000..e4fcab045 --- /dev/null +++ b/src/models/jsonld/EntryPointInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EnumerationInterface.php b/src/models/jsonld/EnumerationInterface.php new file mode 100644 index 000000000..b9d50b8bb --- /dev/null +++ b/src/models/jsonld/EnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'episodeNumber' => ['Integer', 'Text'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfSeason' => ['CreativeWorkSeason'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'director', - 'episodeNumber', - 'musicBy', - 'partOfSeason', - 'partOfSeries', - 'productionCompany', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'director' => ['Person'], - 'episodeNumber' => ['Integer', 'Text'], - 'musicBy' => ['MusicGroup', 'Person'], - 'partOfSeason' => ['CreativeWorkSeason'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'productionCompany' => ['Organization'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - '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. Supersedes directors.', - 'episodeNumber' => 'Position of the episode within an ordered group of episodes.', - 'musicBy' => 'The composer of the soundtrack.', - 'partOfSeason' => 'The season to which this episode belongs.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * Position of the episode within an ordered group of episodes. - * - * @var mixed|int|string [schema.org types: Integer, Text] + * @inheritdoc */ - public $episodeNumber; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'episodeNumber' => 'Position of the episode within an ordered group of episodes.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'partOfSeason' => 'The season to which this episode belongs.', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The season to which this episode belongs. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $partOfSeason; - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'director', 'episodeNumber', 'musicBy', 'partOfSeason', 'partOfSeries', 'productionCompany', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EpisodeInterface.php b/src/models/jsonld/EpisodeInterface.php new file mode 100644 index 000000000..07c8414e0 --- /dev/null +++ b/src/models/jsonld/EpisodeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format). The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled. An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place. The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue. The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode). The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'. The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). The end date - * and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. An eventStatus of an event represents - * its status; particularly useful when an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. The location of for example - * where the event is happening, an organization is located, or where an - * action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. The - * total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). The maximum physical attendee - * capacity of an Event whose eventAttendanceMode is - * OfflineEventAttendanceMode (or the offline aspects, in the case of a - * MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. The CreativeWork - * that captured all or part of this Event. Inverse property: recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. The typical expected age - * range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventAttendanceModeEnumeration.php b/src/models/jsonld/EventAttendanceModeEnumeration.php index 9ff52db82..8ad8d67fb 100644 --- a/src/models/jsonld/EventAttendanceModeEnumeration.php +++ b/src/models/jsonld/EventAttendanceModeEnumeration.php @@ -1,29 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventAttendanceModeEnumerationInterface.php b/src/models/jsonld/EventAttendanceModeEnumerationInterface.php new file mode 100644 index 000000000..b79eaebed --- /dev/null +++ b/src/models/jsonld/EventAttendanceModeEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventCancelledInterface.php b/src/models/jsonld/EventCancelledInterface.php new file mode 100644 index 000000000..67e42932c --- /dev/null +++ b/src/models/jsonld/EventCancelledInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventMovedOnlineInterface.php b/src/models/jsonld/EventMovedOnlineInterface.php new file mode 100644 index 000000000..04c3d14ab --- /dev/null +++ b/src/models/jsonld/EventMovedOnlineInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventPostponedInterface.php b/src/models/jsonld/EventPostponedInterface.php new file mode 100644 index 000000000..4ed0675a8 --- /dev/null +++ b/src/models/jsonld/EventPostponedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventRescheduledInterface.php b/src/models/jsonld/EventRescheduledInterface.php new file mode 100644 index 000000000..5a5ccf749 --- /dev/null +++ b/src/models/jsonld/EventRescheduledInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bookingTime', - 'broker', - 'modifiedTime', - 'priceCurrency', - 'programMembershipUsed', - 'provider', - 'reservationFor', - 'reservationId', - 'reservationStatus', - 'reservedTicket', - 'totalPrice', - 'underName' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bookingTime' => ['DateTime'], - 'broker' => ['Organization', 'Person'], - 'modifiedTime' => ['DateTime'], - 'priceCurrency' => ['Text'], - 'programMembershipUsed' => ['ProgramMembership'], - 'provider' => ['Organization', 'Person'], - 'reservationFor' => ['Thing'], - 'reservationId' => ['Text'], - 'reservationStatus' => ['ReservationStatusType'], - 'reservedTicket' => ['Ticket'], - 'totalPrice' => ['Number', 'PriceSpecification', 'Text'], - 'underName' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bookingTime' => 'The date and time the reservation was booked.', - '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. Supersedes bookingAgent.', - 'modifiedTime' => 'The date and time the reservation was modified.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', - '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. Supersedes carrier.', - 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', - 'reservationId' => 'A unique identifier for the reservation.', - 'reservationStatus' => 'The current status of the reservation.', - 'reservedTicket' => 'A ticket associated with the reservation.', - '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 similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'underName' => 'The person or organization the reservation or ticket is for.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The date and time the reservation was booked. - * - * @var DateTime [schema.org types: DateTime] - */ - public $bookingTime; /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * The date and time the reservation was modified. - * - * @var DateTime [schema.org types: DateTime] - */ - public $modifiedTime; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; - /** - * Any membership in a frequent flyer, hotel loyalty program, etc. being - * applied to the reservation. - * - * @var ProgramMembership [schema.org types: ProgramMembership] - */ - public $programMembershipUsed; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * The thing -- flight, event, restaurant,etc. being reserved. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $reservationFor; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A unique identifier for the reservation. - * - * @var string [schema.org types: Text] - */ - public $reservationId; - /** - * The current status of the reservation. - * - * @var ReservationStatusType [schema.org types: ReservationStatusType] - */ - public $reservationStatus; - /** - * A ticket associated with the reservation. - * - * @var Ticket [schema.org types: Ticket] - */ - public $reservedTicket; - /** - * 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 similiar - * Unicode symbols. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to - * indicate a decimal point. Avoid using these symbols as a readability - * separator. - * - * @var mixed|float|PriceSpecification|string [schema.org types: Number, PriceSpecification, Text] - */ - public $totalPrice; /** - * The person or organization the reservation or ticket is for. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $underName; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bookingTime', 'broker', 'modifiedTime', 'priceCurrency', 'programMembershipUsed', 'provider', 'reservationFor', 'reservationId', 'reservationStatus', 'reservedTicket', 'totalPrice', 'underName'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventReservationInterface.php b/src/models/jsonld/EventReservationInterface.php new file mode 100644 index 000000000..1666bdfc7 --- /dev/null +++ b/src/models/jsonld/EventReservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventScheduledInterface.php b/src/models/jsonld/EventScheduledInterface.php new file mode 100644 index 000000000..fd6b162e4 --- /dev/null +++ b/src/models/jsonld/EventScheduledInterface.php @@ -0,0 +1,24 @@ + ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; - /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] - */ - public $subEvent; - // Static Protected Properties - // ========================================================================= /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $translator; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } + /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workFeatured; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventSeriesInterface.php b/src/models/jsonld/EventSeriesInterface.php new file mode 100644 index 000000000..186dbe789 --- /dev/null +++ b/src/models/jsonld/EventSeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventStatusTypeInterface.php b/src/models/jsonld/EventStatusTypeInterface.php new file mode 100644 index 000000000..04258e589 --- /dev/null +++ b/src/models/jsonld/EventStatusTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EventVenueInterface.php b/src/models/jsonld/EventVenueInterface.php new file mode 100644 index 000000000..1391bf682 --- /dev/null +++ b/src/models/jsonld/EventVenueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EvidenceLevelAInterface.php b/src/models/jsonld/EvidenceLevelAInterface.php new file mode 100644 index 000000000..c7743f310 --- /dev/null +++ b/src/models/jsonld/EvidenceLevelAInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EvidenceLevelBInterface.php b/src/models/jsonld/EvidenceLevelBInterface.php new file mode 100644 index 000000000..21cdd4450 --- /dev/null +++ b/src/models/jsonld/EvidenceLevelBInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EvidenceLevelCInterface.php b/src/models/jsonld/EvidenceLevelCInterface.php new file mode 100644 index 000000000..3a6327616 --- /dev/null +++ b/src/models/jsonld/EvidenceLevelCInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'currency' => ['Text'], + 'currentExchangeRate' => ['UnitPriceSpecification'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'exchangeRateSpread' => ['Number', 'MonetaryAmount'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currency', - 'currentExchangeRate', - 'exchangeRateSpread' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currency' => ['Text'], - 'currentExchangeRate' => ['UnitPriceSpecification'], - 'exchangeRateSpread' => ['MonetaryAmount', 'Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'currency' => 'The currency in which the monetary amount is expressed. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'currentExchangeRate' => 'The current price of a currency.', - 'exchangeRateSpread' => 'The difference between the price at which a broker or other intermediary buys and sells foreign currency.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'currency' => 'The currency in which the monetary amount is expressed. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'currentExchangeRate' => 'The current price of a currency.', + 'description' => 'A description of the item.', + '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.', + 'exchangeRateSpread' => 'The difference between the price at which a broker or other intermediary buys and sells foreign currency.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency in which the monetary amount is expressed. Use standard - * formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for - * cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings - * Systems (LETS) and other currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currency; - /** - * The current price of a currency. - * - * @var UnitPriceSpecification [schema.org types: UnitPriceSpecification] - */ - public $currentExchangeRate; /** - * The difference between the price at which a broker or other intermediary - * buys and sells foreign currency. - * - * @var mixed|MonetaryAmount|float [schema.org types: MonetaryAmount, Number] + * @inheritdoc */ - public $exchangeRateSpread; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currency', 'currentExchangeRate', 'exchangeRateSpread'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ExchangeRateSpecificationInterface.php b/src/models/jsonld/ExchangeRateSpecificationInterface.php new file mode 100644 index 000000000..5a55ee402 --- /dev/null +++ b/src/models/jsonld/ExchangeRateSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ExchangeRefundInterface.php b/src/models/jsonld/ExchangeRefundInterface.php new file mode 100644 index 000000000..21869342c --- /dev/null +++ b/src/models/jsonld/ExchangeRefundInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'course' => ['Place'], + 'description' => ['Text'], + 'diet' => ['Diet'], + 'disambiguatingDescription' => ['Text'], + 'distance' => ['Distance'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'event' => ['Event'], + 'exerciseCourse' => ['Place'], + 'exercisePlan' => ['ExercisePlan'], + 'exerciseRelatedDiet' => ['Diet'], + 'exerciseType' => ['Text'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'opponent' => ['Person'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'sportsActivityLocation' => ['SportsActivityLocation'], + 'sportsEvent' => ['SportsEvent'], + 'sportsTeam' => ['SportsTeam'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'diet', - 'distance', - 'exerciseCourse', - 'exercisePlan', - 'exerciseRelatedDiet', - 'exerciseType', - 'fromLocation', - 'opponent', - 'sportsActivityLocation', - 'sportsEvent', - 'sportsTeam', - 'toLocation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'diet' => ['Diet'], - 'distance' => ['Distance'], - 'exerciseCourse' => ['Place'], - 'exercisePlan' => ['ExercisePlan'], - 'exerciseRelatedDiet' => ['Diet'], - 'exerciseType' => ['Text'], - 'fromLocation' => ['Place'], - 'opponent' => ['Person'], - 'sportsActivityLocation' => ['SportsActivityLocation'], - 'sportsEvent' => ['SportsEvent'], - 'sportsTeam' => ['SportsTeam'], - 'toLocation' => ['Place'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'diet' => 'A sub property of instrument. The diet used in this action.', - 'distance' => 'The distance travelled, e.g. exercising or travelling.', - 'exerciseCourse' => 'A sub property of location. The course where this action was taken. Supersedes course.', - 'exercisePlan' => 'A sub property of instrument. The exercise plan used on this action.', - 'exerciseRelatedDiet' => 'A sub property of instrument. The diet used in this action.', - 'exerciseType' => 'Type(s) of exercise or activity, such as strength training, flexibility training, aerobics, cardiac rehabilitation, etc.', - 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', - 'opponent' => 'A sub property of participant. The opponent on this action.', - 'sportsActivityLocation' => 'A sub property of location. The sports activity location where this action occurred.', - 'sportsEvent' => 'A sub property of location. The sports event where this action occurred.', - 'sportsTeam' => 'A sub property of participant. The sports team that participated on this action.', - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of instrument. The diet used in this action. - * - * @var Diet [schema.org types: Diet] - */ - public $diet; /** - * The distance travelled, e.g. exercising or travelling. - * - * @var Distance [schema.org types: Distance] - */ - public $distance; - /** - * A sub property of location. The course where this action was taken. - * Supersedes course. - * - * @var Place [schema.org types: Place] - */ - public $exerciseCourse; - /** - * A sub property of instrument. The exercise plan used on this action. - * - * @var ExercisePlan [schema.org types: ExercisePlan] - */ - public $exercisePlan; - /** - * A sub property of instrument. The diet used in this action. - * - * @var Diet [schema.org types: Diet] - */ - public $exerciseRelatedDiet; - /** - * Type(s) of exercise or activity, such as strength training, flexibility - * training, aerobics, cardiac rehabilitation, etc. - * - * @var string [schema.org types: Text] - */ - public $exerciseType; - /** - * A sub property of location. The original location of the object or the - * agent before the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $fromLocation; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'course' => 'A sub property of location. The course where this action was taken.', + 'description' => 'A description of the item.', + 'diet' => 'A sub property of instrument. The diet used in this action.', + '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.', + 'distance' => 'The distance travelled, e.g. exercising or travelling.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'exerciseCourse' => 'A sub property of location. The course where this action was taken.', + 'exercisePlan' => 'A sub property of instrument. The exercise plan used on this action.', + 'exerciseRelatedDiet' => 'A sub property of instrument. The diet used in this action.', + 'exerciseType' => 'Type(s) of exercise or activity, such as strength training, flexibility training, aerobics, cardiac rehabilitation, etc.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'opponent' => 'A sub property of participant. The opponent on this action.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'sportsActivityLocation' => 'A sub property of location. The sports activity location where this action occurred.', + 'sportsEvent' => 'A sub property of location. The sports event where this action occurred.', + 'sportsTeam' => 'A sub property of participant. The sports team that participated on this action.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A sub property of participant. The opponent on this action. - * - * @var Person [schema.org types: Person] - */ - public $opponent; - /** - * A sub property of location. The sports activity location where this action - * occurred. - * - * @var SportsActivityLocation [schema.org types: SportsActivityLocation] - */ - public $sportsActivityLocation; - /** - * A sub property of location. The sports event where this action occurred. - * - * @var SportsEvent [schema.org types: SportsEvent] - */ - public $sportsEvent; - /** - * A sub property of participant. The sports team that participated on this - * action. - * - * @var SportsTeam [schema.org types: SportsTeam] - */ - public $sportsTeam; /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['diet', 'distance', 'exerciseCourse', 'exercisePlan', 'exerciseRelatedDiet', 'exerciseType', 'fromLocation', 'opponent', 'sportsActivityLocation', 'sportsEvent', 'sportsTeam', 'toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ExerciseActionInterface.php b/src/models/jsonld/ExerciseActionInterface.php new file mode 100644 index 000000000..e82731661 --- /dev/null +++ b/src/models/jsonld/ExerciseActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ExerciseGymInterface.php b/src/models/jsonld/ExerciseGymInterface.php new file mode 100644 index 000000000..5a7058063 --- /dev/null +++ b/src/models/jsonld/ExerciseGymInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'activityDuration' => ['Duration', 'QuantitativeValue'], + 'activityFrequency' => ['Text', 'QuantitativeValue'], + 'additionalType' => ['URL'], + 'additionalVariable' => ['Text'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'code' => ['MedicalCode'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'epidemiology' => ['Text'], + 'exampleOfWork' => ['CreativeWork'], + 'exerciseType' => ['Text'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'guideline' => ['MedicalGuideline'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'intensity' => ['QuantitativeValue', 'Text'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'medicineSystem' => ['MedicineSystem'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pathophysiology' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recognizingAuthority' => ['Organization'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'repetitions' => ['Number', 'QuantitativeValue'], + 'restPeriods' => ['Text', 'QuantitativeValue'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'workload' => ['QuantitativeValue', 'Energy'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'activityDuration', - 'activityFrequency', - 'additionalVariable', - 'exerciseType', - 'intensity', - 'repetitions', - 'restPeriods', - 'workload' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'activityDuration' => ['Duration', 'QualitativeValue'], - 'activityFrequency' => ['QualitativeValue', 'Text'], - 'additionalVariable' => ['Text'], - 'exerciseType' => ['Text'], - 'intensity' => ['QualitativeValue', 'Text'], - 'repetitions' => ['Number', 'QualitativeValue'], - 'restPeriods' => ['QualitativeValue', 'Text'], - 'workload' => ['Energy', 'QualitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'activityDuration' => 'Length of time to engage in the activity.', - 'activityFrequency' => 'How often one should engage in the activity.', - 'additionalVariable' => 'Any additional component of the exercise prescription that may need to be articulated to the patient. This may include the order of exercises, the number of repetitions of movement, quantitative distance, progressions over time, etc.', - 'exerciseType' => 'Type(s) of exercise or activity, such as strength training, flexibility training, aerobics, cardiac rehabilitation, etc.', - 'intensity' => 'Quantitative measure gauging the degree of force involved in the exercise, for example, heartbeats per minute. May include the velocity of the movement.', - 'repetitions' => 'Number of times one should repeat the activity.', - 'restPeriods' => 'How often one should break from the activity.', - 'workload' => 'Quantitative measure of the physiologic output of the exercise; also referred to as energy expenditure.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Length of time to engage in the activity. - * - * @var mixed|Duration|QualitativeValue [schema.org types: Duration, QualitativeValue] - */ - public $activityDuration; - /** - * How often one should engage in the activity. - * - * @var mixed|QualitativeValue|string [schema.org types: QualitativeValue, Text] - */ - public $activityFrequency; - /** - * Any additional component of the exercise prescription that may need to be - * articulated to the patient. This may include the order of exercises, the - * number of repetitions of movement, quantitative distance, progressions over - * time, etc. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $additionalVariable; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + 'activityDuration' => 'Length of time to engage in the activity.', + 'activityFrequency' => 'How often one should engage in the activity.', + '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.', + 'additionalVariable' => 'Any additional component of the exercise prescription that may need to be articulated to the patient. This may include the order of exercises, the number of repetitions of movement, quantitative distance, progressions over time, etc.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'exerciseType' => 'Type(s) of exercise or activity, such as strength training, flexibility training, aerobics, cardiac rehabilitation, etc.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'guideline' => 'A medical guideline related to this entity.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'intensity' => 'Quantitative measure gauging the degree of force involved in the exercise, for example, heartbeats per minute. May include the velocity of the movement.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'repetitions' => 'Number of times one should repeat the activity.', + 'restPeriods' => 'How often one should break from the activity.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'workload' => 'Quantitative measure of the physiologic output of the exercise; also referred to as energy expenditure.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Type(s) of exercise or activity, such as strength training, flexibility - * training, aerobics, cardiac rehabilitation, etc. - * - * @var string [schema.org types: Text] - */ - public $exerciseType; - /** - * Quantitative measure gauging the degree of force involved in the exercise, - * for example, heartbeats per minute. May include the velocity of the - * movement. - * - * @var mixed|QualitativeValue|string [schema.org types: QualitativeValue, Text] - */ - public $intensity; - /** - * Number of times one should repeat the activity. - * - * @var mixed|float|QualitativeValue [schema.org types: Number, QualitativeValue] - */ - public $repetitions; /** - * How often one should break from the activity. - * - * @var mixed|QualitativeValue|string [schema.org types: QualitativeValue, Text] - */ - public $restPeriods; - /** - * Quantitative measure of the physiologic output of the exercise; also - * referred to as energy expenditure. - * - * @var mixed|Energy|QualitativeValue [schema.org types: Energy, QualitativeValue] + * @inheritdoc */ - public $workload; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['activityDuration', 'activityFrequency', 'additionalVariable', 'exerciseType', 'intensity', 'repetitions', 'restPeriods', 'workload'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ExercisePlanInterface.php b/src/models/jsonld/ExercisePlanInterface.php new file mode 100644 index 000000000..607aa42ab --- /dev/null +++ b/src/models/jsonld/ExercisePlanInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ExhibitionEventInterface.php b/src/models/jsonld/ExhibitionEventInterface.php new file mode 100644 index 000000000..aaae0fc6c --- /dev/null +++ b/src/models/jsonld/ExhibitionEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/EyeInterface.php b/src/models/jsonld/EyeInterface.php new file mode 100644 index 000000000..59e043995 --- /dev/null +++ b/src/models/jsonld/EyeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FAQPageInterface.php b/src/models/jsonld/FAQPageInterface.php new file mode 100644 index 000000000..79fa4d790 --- /dev/null +++ b/src/models/jsonld/FAQPageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FDAcategoryAInterface.php b/src/models/jsonld/FDAcategoryAInterface.php new file mode 100644 index 000000000..f53084600 --- /dev/null +++ b/src/models/jsonld/FDAcategoryAInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FDAcategoryBInterface.php b/src/models/jsonld/FDAcategoryBInterface.php new file mode 100644 index 000000000..52778a7ea --- /dev/null +++ b/src/models/jsonld/FDAcategoryBInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FDAcategoryCInterface.php b/src/models/jsonld/FDAcategoryCInterface.php new file mode 100644 index 000000000..c11ab064f --- /dev/null +++ b/src/models/jsonld/FDAcategoryCInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FDAcategoryDInterface.php b/src/models/jsonld/FDAcategoryDInterface.php new file mode 100644 index 000000000..90ccb1674 --- /dev/null +++ b/src/models/jsonld/FDAcategoryDInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FDAcategoryXInterface.php b/src/models/jsonld/FDAcategoryXInterface.php new file mode 100644 index 000000000..76f7f0789 --- /dev/null +++ b/src/models/jsonld/FDAcategoryXInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FDAnotEvaluatedInterface.php b/src/models/jsonld/FDAnotEvaluatedInterface.php new file mode 100644 index 000000000..fe03782f6 --- /dev/null +++ b/src/models/jsonld/FDAnotEvaluatedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'broadcastChannelId' => ['Text'], + 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], + 'broadcastServiceTier' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'genre' => ['URL', 'Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inBroadcastLineup' => ['CableOrSatelliteService'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'providesBroadcastService' => ['BroadcastService'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'broadcastChannelId', - 'broadcastFrequency', - 'broadcastServiceTier', - 'genre', - 'inBroadcastLineup', - 'providesBroadcastService' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'broadcastChannelId' => ['Text'], - 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], - 'broadcastServiceTier' => ['Text'], - 'genre' => ['Text', 'URL'], - 'inBroadcastLineup' => ['CableOrSatelliteService'], - 'providesBroadcastService' => ['BroadcastService'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', - 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', - 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', - 'providesBroadcastService' => 'The BroadcastService offered on this channel. Inverse property: hasBroadcastChannel.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The unique address by which the BroadcastService can be identified in a - * provider lineup. In US, this is typically a number. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $broadcastChannelId; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', + 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', + 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', + 'description' => 'A description of the item.', + '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.', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'providesBroadcastService' => 'The BroadcastService offered on this channel.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The frequency used for over-the-air broadcasts. Numeric values or simple - * ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences - * of AM and FM radio channels, e.g. "87 FM". - * - * @var mixed|BroadcastFrequencySpecification|string [schema.org types: BroadcastFrequencySpecification, Text] - */ - public $broadcastFrequency; /** - * The type of service required to have access to the channel (e.g. Standard - * or Premium). - * - * @var string [schema.org types: Text] - */ - public $broadcastServiceTier; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * The CableOrSatelliteService offering the channel. - * - * @var CableOrSatelliteService [schema.org types: CableOrSatelliteService] - */ - public $inBroadcastLineup; - /** - * The BroadcastService offered on this channel. Inverse property: - * hasBroadcastChannel. - * - * @var BroadcastService [schema.org types: BroadcastService] + * @inheritdoc */ - public $providesBroadcastService; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['broadcastChannelId', 'broadcastFrequency', 'broadcastServiceTier', 'genre', 'inBroadcastLineup', 'providesBroadcastService'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FMRadioChannelInterface.php b/src/models/jsonld/FMRadioChannelInterface.php new file mode 100644 index 000000000..5a70ce5b2 --- /dev/null +++ b/src/models/jsonld/FMRadioChannelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FailedActionStatusInterface.php b/src/models/jsonld/FailedActionStatusInterface.php new file mode 100644 index 000000000..301d4dfcd --- /dev/null +++ b/src/models/jsonld/FailedActionStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return []; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return []; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/FalseInterface.php b/src/models/jsonld/FalseInterface.php new file mode 100644 index 000000000..139088e33 --- /dev/null +++ b/src/models/jsonld/FalseInterface.php @@ -0,0 +1,24 @@ + ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] - ]); - - return $rules; - } -} diff --git a/src/models/jsonld/FastFoodRestaurant.php b/src/models/jsonld/FastFoodRestaurant.php index 9fef1c842..3390c834c 100644 --- a/src/models/jsonld/FastFoodRestaurant.php +++ b/src/models/jsonld/FastFoodRestaurant.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FastFoodRestaurantInterface.php b/src/models/jsonld/FastFoodRestaurantInterface.php new file mode 100644 index 000000000..4f611d58b --- /dev/null +++ b/src/models/jsonld/FastFoodRestaurantInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FemaleInterface.php b/src/models/jsonld/FemaleInterface.php new file mode 100644 index 000000000..cd0944ccf --- /dev/null +++ b/src/models/jsonld/FemaleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FestivalInterface.php b/src/models/jsonld/FestivalInterface.php new file mode 100644 index 000000000..2c9243aa5 --- /dev/null +++ b/src/models/jsonld/FestivalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FilmActionInterface.php b/src/models/jsonld/FilmActionInterface.php new file mode 100644 index 000000000..7d82c0822 --- /dev/null +++ b/src/models/jsonld/FilmActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'annualPercentageRate', - 'feesAndCommissionsSpecification', - 'interestRate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'annualPercentageRate' => ['Number', 'QuantitativeValue'], - 'feesAndCommissionsSpecification' => ['Text', 'URL'], - 'interestRate' => ['Number', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', - 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', - 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The annual rate that is charged for borrowing (or made by investing), - * expressed as a single percentage number that represents the actual yearly - * cost of funds over the term of a loan. This includes any fees or additional - * costs associated with the transaction. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $annualPercentageRate; - /** - * Description of fees, commissions, and other terms applied either to a class - * of financial product, or by a financial service organization. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $feesAndCommissionsSpecification; /** - * The interest rate, charged or paid, applicable to the financial product. - * Note: This is different from the calculated annualPercentageRate. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] + * @inheritdoc */ - public $interestRate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['annualPercentageRate', 'feesAndCommissionsSpecification', 'interestRate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FinancialProductInterface.php b/src/models/jsonld/FinancialProductInterface.php new file mode 100644 index 000000000..ceaf7033d --- /dev/null +++ b/src/models/jsonld/FinancialProductInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'feesAndCommissionsSpecification' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'feesAndCommissionsSpecification' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Description of fees, commissions, and other terms applied either to a class - * of financial product, or by a financial service organization. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $feesAndCommissionsSpecification; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['feesAndCommissionsSpecification'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FinancialServiceInterface.php b/src/models/jsonld/FinancialServiceInterface.php new file mode 100644 index 000000000..129ba697b --- /dev/null +++ b/src/models/jsonld/FinancialServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FindActionInterface.php b/src/models/jsonld/FindActionInterface.php new file mode 100644 index 000000000..d89ac78f2 --- /dev/null +++ b/src/models/jsonld/FindActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FireStationInterface.php b/src/models/jsonld/FireStationInterface.php new file mode 100644 index 000000000..dabb717fb --- /dev/null +++ b/src/models/jsonld/FireStationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FlexibilityInterface.php b/src/models/jsonld/FlexibilityInterface.php new file mode 100644 index 000000000..54bb15e72 --- /dev/null +++ b/src/models/jsonld/FlexibilityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aircraft' => ['Vehicle', 'Text'], + 'alternateName' => ['Text'], + 'arrivalAirport' => ['Airport'], + 'arrivalGate' => ['Text'], + 'arrivalTerminal' => ['Text'], + 'arrivalTime' => ['Time', 'DateTime'], + 'boardingPolicy' => ['BoardingPolicyType'], + 'carrier' => ['Organization'], + 'departureAirport' => ['Airport'], + 'departureGate' => ['Text'], + 'departureTerminal' => ['Text'], + 'departureTime' => ['Time', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'estimatedFlightDuration' => ['Text', 'Duration'], + 'flightDistance' => ['Distance', 'Text'], + 'flightNumber' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itinerary' => ['ItemList', 'Place'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'mealService' => ['Text'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfTrip' => ['Trip'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'sameAs' => ['URL'], + 'seller' => ['Organization', 'Person'], + 'subTrip' => ['Trip'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'webCheckinTime' => ['DateTime'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'aircraft', - 'arrivalAirport', - 'arrivalGate', - 'arrivalTerminal', - 'boardingPolicy', - 'departureAirport', - 'departureGate', - 'departureTerminal', - 'estimatedFlightDuration', - 'flightDistance', - 'flightNumber', - 'mealService', - 'seller', - 'webCheckinTime' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'aircraft' => ['Text', 'Vehicle'], - 'arrivalAirport' => ['Airport'], - 'arrivalGate' => ['Text'], - 'arrivalTerminal' => ['Text'], - 'boardingPolicy' => ['BoardingPolicyType'], - 'departureAirport' => ['Airport'], - 'departureGate' => ['Text'], - 'departureTerminal' => ['Text'], - 'estimatedFlightDuration' => ['Duration', 'Text'], - 'flightDistance' => ['Distance', 'Text'], - 'flightNumber' => ['Text'], - 'mealService' => ['Text'], - 'seller' => ['Organization', 'Person'], - 'webCheckinTime' => ['DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'aircraft' => 'The kind of aircraft (e.g., "Boeing 747").', - 'arrivalAirport' => 'The airport where the flight terminates.', - 'arrivalGate' => 'Identifier of the flight\'s arrival gate.', - 'arrivalTerminal' => 'Identifier of the flight\'s arrival terminal.', - 'boardingPolicy' => 'The type of boarding policy used by the airline (e.g. zone-based or group-based).', - 'departureAirport' => 'The airport where the flight originates.', - 'departureGate' => 'Identifier of the flight\'s departure gate.', - 'departureTerminal' => 'Identifier of the flight\'s departure terminal.', - 'estimatedFlightDuration' => 'The estimated time the flight will take.', - 'flightDistance' => 'The distance of the flight.', - 'flightNumber' => 'The unique identifier for a flight including the airline IATA code. For example, if describing United flight 110, where the IATA code for United is \'UA\', the flightNumber is \'UA110\'.', - 'mealService' => 'Description of the meals that will be provided or available for purchase.', - 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider. Supersedes merchant, vendor.', - 'webCheckinTime' => 'The time when a passenger can check into the flight online.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The kind of aircraft (e.g., "Boeing 747"). - * - * @var mixed|string|Vehicle [schema.org types: Text, Vehicle] - */ - public $aircraft; - /** - * The airport where the flight terminates. - * - * @var Airport [schema.org types: Airport] - */ - public $arrivalAirport; /** - * Identifier of the flight's arrival gate. - * - * @var string [schema.org types: Text] - */ - public $arrivalGate; - /** - * Identifier of the flight's arrival terminal. - * - * @var string [schema.org types: Text] - */ - public $arrivalTerminal; - /** - * The type of boarding policy used by the airline (e.g. zone-based or - * group-based). - * - * @var BoardingPolicyType [schema.org types: BoardingPolicyType] - */ - public $boardingPolicy; - /** - * The airport where the flight originates. - * - * @var Airport [schema.org types: Airport] - */ - public $departureAirport; - /** - * Identifier of the flight's departure gate. - * - * @var string [schema.org types: Text] - */ - public $departureGate; - /** - * Identifier of the flight's departure terminal. - * - * @var string [schema.org types: Text] - */ - public $departureTerminal; - /** - * The estimated time the flight will take. - * - * @var mixed|Duration|string [schema.org types: Duration, Text] + * @inheritdoc */ - public $estimatedFlightDuration; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aircraft' => 'The kind of aircraft (e.g., "Boeing 747").', + 'alternateName' => 'An alias for the item.', + 'arrivalAirport' => 'The airport where the flight terminates.', + 'arrivalGate' => 'Identifier of the flight\'s arrival gate.', + 'arrivalTerminal' => 'Identifier of the flight\'s arrival terminal.', + 'arrivalTime' => 'The expected arrival time.', + 'boardingPolicy' => 'The type of boarding policy used by the airline (e.g. zone-based or group-based).', + 'carrier' => '\'carrier\' is an out-dated term indicating the \'provider\' for parcel delivery and flights.', + 'departureAirport' => 'The airport where the flight originates.', + 'departureGate' => 'Identifier of the flight\'s departure gate.', + 'departureTerminal' => 'Identifier of the flight\'s departure terminal.', + 'departureTime' => 'The expected departure time.', + 'description' => 'A description of the item.', + '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.', + 'estimatedFlightDuration' => 'The estimated time the flight will take.', + 'flightDistance' => 'The distance of the flight.', + 'flightNumber' => 'The unique identifier for a flight including the airline IATA code. For example, if describing United flight 110, where the IATA code for United is \'UA\', the flightNumber is \'UA110\'.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itinerary' => 'Destination(s) ( [[Place]] ) that make up a trip. For a trip where destination order is important use [[ItemList]] to specify that order (see examples).', + '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.', + 'mealService' => 'Description of the meals that will be provided or available for purchase.', + 'name' => 'The name of the item.', + '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. ', + 'partOfTrip' => 'Identifies that this [[Trip]] is a subTrip of another Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + '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.', + 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider.', + 'subTrip' => 'Identifies a [[Trip]] that is a subTrip of this Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'webCheckinTime' => 'The time when a passenger can check into the flight online.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The distance of the flight. - * - * @var mixed|Distance|string [schema.org types: Distance, Text] - */ - public $flightDistance; - /** - * The unique identifier for a flight including the airline IATA code. For - * example, if describing United flight 110, where the IATA code for United is - * 'UA', the flightNumber is 'UA110'. - * - * @var string [schema.org types: Text] - */ - public $flightNumber; - /** - * Description of the meals that will be provided or available for purchase. - * - * @var string [schema.org types: Text] - */ - public $mealService; - /** - * An entity which offers (sells / leases / lends / loans) the services / - * goods. A seller may also be a provider. Supersedes merchant, vendor. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $seller; - /** - * The time when a passenger can check into the flight online. - * - * @var DateTime [schema.org types: DateTime] + * @inheritdoc */ - public $webCheckinTime; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['aircraft', 'arrivalAirport', 'arrivalGate', 'arrivalTerminal', 'boardingPolicy', 'departureAirport', 'departureGate', 'departureTerminal', 'estimatedFlightDuration', 'flightDistance', 'flightNumber', 'mealService', 'seller', 'webCheckinTime'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FlightInterface.php b/src/models/jsonld/FlightInterface.php new file mode 100644 index 000000000..d3ffa7216 --- /dev/null +++ b/src/models/jsonld/FlightInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'boardingGroup' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'passengerPriorityStatus' => ['QualitativeValue', 'Text'], + 'passengerSequenceNumber' => ['Text'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'securityScreening' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'boardingGroup', - 'passengerPriorityStatus', - 'passengerSequenceNumber', - 'securityScreening' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'boardingGroup' => ['Text'], - 'passengerPriorityStatus' => ['QualitativeValue', 'Text'], - 'passengerSequenceNumber' => ['Text'], - 'securityScreening' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'boardingGroup' => 'The airline-specific indicator of boarding order / preference.', - 'passengerPriorityStatus' => 'The priority status assigned to a passenger for security or boarding (e.g. FastTrack or Priority).', - 'passengerSequenceNumber' => 'The passenger\'s sequence number as assigned by the airline.', - 'securityScreening' => 'The type of security screening the passenger is subject to.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'boardingGroup' => 'The airline-specific indicator of boarding order / preference.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'passengerPriorityStatus' => 'The priority status assigned to a passenger for security or boarding (e.g. FastTrack or Priority).', + 'passengerSequenceNumber' => 'The passenger\'s sequence number as assigned by the airline.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'securityScreening' => 'The type of security screening the passenger is subject to.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The airline-specific indicator of boarding order / preference. - * - * @var string [schema.org types: Text] - */ - public $boardingGroup; - /** - * The priority status assigned to a passenger for security or boarding (e.g. - * FastTrack or Priority). - * - * @var mixed|QualitativeValue|string [schema.org types: QualitativeValue, Text] - */ - public $passengerPriorityStatus; - /** - * The passenger's sequence number as assigned by the airline. - * - * @var string [schema.org types: Text] - */ - public $passengerSequenceNumber; /** - * The type of security screening the passenger is subject to. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $securityScreening; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['boardingGroup', 'passengerPriorityStatus', 'passengerSequenceNumber', 'securityScreening'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FlightReservationInterface.php b/src/models/jsonld/FlightReservationInterface.php new file mode 100644 index 000000000..e9d0f86f7 --- /dev/null +++ b/src/models/jsonld/FlightReservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return []; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return []; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/FloatInterface.php b/src/models/jsonld/FloatInterface.php new file mode 100644 index 000000000..ce5cdb899 --- /dev/null +++ b/src/models/jsonld/FloatInterface.php @@ -0,0 +1,24 @@ + ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] - ]); - - return $rules; - } -} diff --git a/src/models/jsonld/FloorPlan.php b/src/models/jsonld/FloorPlan.php index 991a6ae02..e2c539a7a 100644 --- a/src/models/jsonld/FloorPlan.php +++ b/src/models/jsonld/FloorPlan.php @@ -1,34 +1,35 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isPlanForApartment' => ['Accommodation'], + 'layoutImage' => ['ImageObject', 'URL'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'numberOfAccommodationUnits' => ['QuantitativeValue'], + 'numberOfAvailableAccommodationUnits' => ['QuantitativeValue'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'petsAllowed' => ['Text', 'Boolean'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amenityFeature', - 'floorSize', - 'isPlanForApartment', - 'numberOfAccommodationUnits', - 'numberOfAvailableAccommodationUnits', - 'numberOfBathroomsTotal', - 'numberOfBedrooms', - 'numberOfFullBathrooms', - 'numberOfPartialBathrooms', - 'numberOfRooms', - 'petsAllowed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amenityFeature' => ['LocationFeatureSpecification'], - 'floorSize' => ['QuantitativeValue'], - 'isPlanForApartment' => ['Accommodation'], - 'numberOfAccommodationUnits' => ['QuantitativeValue'], - 'numberOfAvailableAccommodationUnits' => ['QuantitativeValue'], - 'numberOfBathroomsTotal' => ['Integer'], - 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], - 'numberOfFullBathrooms' => ['Number'], - 'numberOfPartialBathrooms' => ['Number'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'petsAllowed' => ['Boolean', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard', - 'isPlanForApartment' => 'Indicates some accommodation that this floor plan describes.', - 'numberOfAccommodationUnits' => 'Indicates the total (available plus unavailable) number of accommodation units in an ApartmentComplex, or the number of accommodation units for a specific FloorPlan (within its specific ApartmentComplex). See also numberOfAvailableAccommodationUnits.', - 'numberOfAvailableAccommodationUnits' => 'Indicates the number of available accommodation units in an ApartmentComplex, or the number of accommodation units for a specific FloorPlan (within its specific ApartmentComplex). See also numberOfAccommodationUnits.', - 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some Accommodation, following real estate conventions as documented in RESO: "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also numberOfRooms.', - 'numberOfBedrooms' => 'The total integer number of bedrooms in a some Accommodation, ApartmentComplex or FloorPlan.', - 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an Accommodation. This corresponds to the BathroomsFull field in RESO.', - 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an Accommodation. This corresponds to the BathroomsPartial field in RESO.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * The size of the accommodation, e.g. in square meter or squarefoot. Typical - * unit code(s): MTK for square meter, FTK for square foot, or YDK for square - * yard - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $floorSize; - /** - * Indicates some accommodation that this floor plan describes. - * - * @var Accommodation [schema.org types: Accommodation] - */ - public $isPlanForApartment; - /** - * Indicates the total (available plus unavailable) number of accommodation - * units in an ApartmentComplex, or the number of accommodation units for a - * specific FloorPlan (within its specific ApartmentComplex). See also - * numberOfAvailableAccommodationUnits. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfAccommodationUnits; - /** - * Indicates the number of available accommodation units in an - * ApartmentComplex, or the number of accommodation units for a specific - * FloorPlan (within its specific ApartmentComplex). See also - * numberOfAccommodationUnits. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfAvailableAccommodationUnits; - /** - * The total integer number of bathrooms in a some Accommodation, following - * real estate conventions as documented in RESO: "The simple sum of the - * number of bathrooms. For example for a property with two Full Bathrooms and - * one Half Bathroom, the Bathrooms Total Integer will be 3.". See also - * numberOfRooms. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $numberOfBathroomsTotal; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'description' => 'A description of the item.', + '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.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isPlanForApartment' => 'Indicates some accommodation that this floor plan describes.', + 'layoutImage' => 'A schematic image showing the floorplan layout.', + '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.', + 'name' => 'The name of the item.', + 'numberOfAccommodationUnits' => 'Indicates the total (available plus unavailable) number of accommodation units in an [[ApartmentComplex]], or the number of accommodation units for a specific [[FloorPlan]] (within its specific [[ApartmentComplex]]). See also [[numberOfAvailableAccommodationUnits]].', + 'numberOfAvailableAccommodationUnits' => 'Indicates the number of available accommodation units in an [[ApartmentComplex]], or the number of accommodation units for a specific [[FloorPlan]] (within its specific [[ApartmentComplex]]). See also [[numberOfAccommodationUnits]].', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The total integer number of bedrooms in a some Accommodation, - * ApartmentComplex or FloorPlan. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfBedrooms; - /** - * Number of full bathrooms - The total number of full and ¾ bathrooms in an - * Accommodation. This corresponds to the BathroomsFull field in RESO. - * - * @var float [schema.org types: Number] - */ - public $numberOfFullBathrooms; - /** - * Number of partial bathrooms - The total number of half and ¼ bathrooms in - * an Accommodation. This corresponds to the BathroomsPartial field in RESO. - * - * @var float [schema.org types: Number] - */ - public $numberOfPartialBathrooms; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] + * @inheritdoc */ - public $petsAllowed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amenityFeature', 'floorSize', 'isPlanForApartment', 'numberOfAccommodationUnits', 'numberOfAvailableAccommodationUnits', 'numberOfBathroomsTotal', 'numberOfBedrooms', 'numberOfFullBathrooms', 'numberOfPartialBathrooms', 'numberOfRooms', 'petsAllowed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FloorPlanInterface.php b/src/models/jsonld/FloorPlanInterface.php new file mode 100644 index 000000000..39dfa602d --- /dev/null +++ b/src/models/jsonld/FloorPlanInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FloristInterface.php b/src/models/jsonld/FloristInterface.php new file mode 100644 index 000000000..4d46ba69e --- /dev/null +++ b/src/models/jsonld/FloristInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'followee' => ['Organization', 'Person'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'followee' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'followee' => 'A sub property of object. The person or organization being followed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'followee' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'followee' => 'A sub property of object. The person or organization being followed.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of object. The person or organization being followed. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $followee; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['followee'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FollowActionInterface.php b/src/models/jsonld/FollowActionInterface.php new file mode 100644 index 000000000..e8893e21f --- /dev/null +++ b/src/models/jsonld/FollowActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FoodEstablishmentInterface.php b/src/models/jsonld/FoodEstablishmentInterface.php new file mode 100644 index 000000000..ff49237d8 --- /dev/null +++ b/src/models/jsonld/FoodEstablishmentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'partySize' => ['Integer', 'QuantitativeValue'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'endTime', - 'partySize', - 'startTime' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'endTime' => ['DateTime', 'Time'], - 'partySize' => ['Integer', 'QuantitativeValue'], - 'startTime' => ['DateTime', 'Time'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'partySize' => 'Number of people the reservation should accommodate.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'partySize' => 'Number of people the reservation should accommodate.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * Number of people the reservation should accommodate. - * - * @var mixed|int|QuantitativeValue [schema.org types: Integer, QuantitativeValue] - */ - public $partySize; /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] + * @inheritdoc */ - public $startTime; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['endTime', 'partySize', 'startTime'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FoodEstablishmentReservationInterface.php b/src/models/jsonld/FoodEstablishmentReservationInterface.php new file mode 100644 index 000000000..811d22f4c --- /dev/null +++ b/src/models/jsonld/FoodEstablishmentReservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FoodEventInterface.php b/src/models/jsonld/FoodEventInterface.php new file mode 100644 index 000000000..104b6ff35 --- /dev/null +++ b/src/models/jsonld/FoodEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'aggregateRating', - 'areaServed', - 'audience', - 'availableChannel', - 'award', - 'brand', - 'broker', - 'category', - 'hasOfferCatalog', - 'hoursAvailable', - 'isRelatedTo', - 'isSimilarTo', - 'logo', - 'offers', - 'provider', - 'providerMobility', - 'review', - 'serviceOutput', - 'serviceType', - 'slogan', - 'termsOfService' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'aggregateRating' => ['AggregateRating'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'audience' => ['Audience'], - 'availableChannel' => ['ServiceChannel'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'broker' => ['Organization', 'Person'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hoursAvailable' => ['OpeningHoursSpecification'], - 'isRelatedTo' => ['Product', 'Service'], - 'isSimilarTo' => ['Product', 'Service'], - 'logo' => ['ImageObject', 'URL'], - 'offers' => ['Demand', 'Offer'], - 'provider' => ['Organization', 'Person'], - 'providerMobility' => ['Text'], - 'review' => ['Review'], - 'serviceOutput' => ['Thing'], - 'serviceType' => ['Text'], - 'slogan' => ['Text'], - 'termsOfService' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - '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. Supersedes bookingAgent.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hoursAvailable' => 'The hours during which this service or contact is available.', - 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', - 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', - 'logo' => 'An associated logo.', - '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. Inverse property: itemOffered.', - '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. Supersedes carrier.', - 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', - 'review' => 'A review of the item. Supersedes reviews.', - 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc. Supersedes produces.', - 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', - 'slogan' => 'A slogan or motto associated with the item.', - 'termsOfService' => 'Human-readable terms of service documentation.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A means of accessing the service (e.g. a phone bank, a web site, a - * location, etc.). - * - * @var ServiceChannel [schema.org types: ServiceChannel] - */ - public $availableChannel; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * The hours during which this service or contact is available. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $hoursAvailable; - /** - * A pointer to another, somehow related product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isRelatedTo; - /** - * A pointer to another, functionally similar product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isSimilarTo; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * Indicates the mobility of a provided service (e.g. 'static', 'dynamic'). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $providerMobility; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * The tangible thing generated by the service, e.g. a passport, permit, etc. - * Supersedes produces. - * - * @var Thing [schema.org types: Thing] - */ - public $serviceOutput; - /** - * The type of service being offered, e.g. veterans' benefits, emergency - * relief, etc. - * - * @var string [schema.org types: Text] - */ - public $serviceType; /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Human-readable terms of service documentation. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $termsOfService; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['aggregateRating', 'areaServed', 'audience', 'availableChannel', 'award', 'brand', 'broker', 'category', 'hasOfferCatalog', 'hoursAvailable', 'isRelatedTo', 'isSimilarTo', 'logo', 'offers', 'provider', 'providerMobility', 'review', 'serviceOutput', 'serviceType', 'slogan', 'termsOfService'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FoodServiceInterface.php b/src/models/jsonld/FoodServiceInterface.php new file mode 100644 index 000000000..8b0589d3d --- /dev/null +++ b/src/models/jsonld/FoodServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FourWheelDriveConfigurationInterface.php b/src/models/jsonld/FourWheelDriveConfigurationInterface.php new file mode 100644 index 000000000..4078f13ba --- /dev/null +++ b/src/models/jsonld/FourWheelDriveConfigurationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/FreeReturnInterface.php b/src/models/jsonld/FreeReturnInterface.php new file mode 100644 index 000000000..0112c2250 --- /dev/null +++ b/src/models/jsonld/FreeReturnInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FridayInterface.php b/src/models/jsonld/FridayInterface.php new file mode 100644 index 000000000..34e4b911c --- /dev/null +++ b/src/models/jsonld/FridayInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FrontWheelDriveConfigurationInterface.php b/src/models/jsonld/FrontWheelDriveConfigurationInterface.php new file mode 100644 index 000000000..a73e99158 --- /dev/null +++ b/src/models/jsonld/FrontWheelDriveConfigurationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/FullGameAvailabilityInterface.php b/src/models/jsonld/FullGameAvailabilityInterface.php new file mode 100644 index 000000000..6cb59e0c0 --- /dev/null +++ b/src/models/jsonld/FullGameAvailabilityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FullRefundInterface.php b/src/models/jsonld/FullRefundInterface.php new file mode 100644 index 000000000..fb9ce417a --- /dev/null +++ b/src/models/jsonld/FullRefundInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FundingAgencyInterface.php b/src/models/jsonld/FundingAgencyInterface.php new file mode 100644 index 000000000..0aa87ff8f --- /dev/null +++ b/src/models/jsonld/FundingAgencyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FundingSchemeInterface.php b/src/models/jsonld/FundingSchemeInterface.php new file mode 100644 index 000000000..b958eed17 --- /dev/null +++ b/src/models/jsonld/FundingSchemeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FungusInterface.php b/src/models/jsonld/FungusInterface.php new file mode 100644 index 000000000..db57a27a1 --- /dev/null +++ b/src/models/jsonld/FungusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/FurnitureStoreInterface.php b/src/models/jsonld/FurnitureStoreInterface.php new file mode 100644 index 000000000..5cfe3d746 --- /dev/null +++ b/src/models/jsonld/FurnitureStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'characterAttribute' => ['Thing'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'gameItem' => ['Thing'], + 'gameLocation' => ['Place', 'URL', 'PostalAddress'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numberOfPlayers' => ['QuantitativeValue'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'quest' => ['Thing'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'characterAttribute', - 'gameItem', - 'gameLocation', - 'numberOfPlayers', - 'quest' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'characterAttribute' => ['Thing'], - 'gameItem' => ['Thing'], - 'gameLocation' => ['Place', 'PostalAddress', 'URL'], - 'numberOfPlayers' => ['QuantitativeValue'], - 'quest' => ['Thing'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'characterAttribute' => 'A piece of data that represents a particular aspect of a fictional character (skill, power, character points, advantage, disadvantage).', - 'gameItem' => 'An item is an object within the game world that can be collected by a player or, occasionally, a non-player character.', - 'gameLocation' => 'Real or fictional location of the game (or part of game).', - 'numberOfPlayers' => 'Indicate how many people can play this game (minimum, maximum, or range).', - 'quest' => 'The task that a player-controlled character, or group of characters may complete in order to gain a reward.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'characterAttribute' => 'A piece of data that represents a particular aspect of a fictional character (skill, power, character points, advantage, disadvantage).', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gameItem' => 'An item is an object within the game world that can be collected by a player or, occasionally, a non-player character.', + 'gameLocation' => 'Real or fictional location of the game (or part of game).', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numberOfPlayers' => 'Indicate how many people can play this game (minimum, maximum, or range).', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'quest' => 'The task that a player-controlled character, or group of characters may complete in order to gain a reward.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A piece of data that represents a particular aspect of a fictional - * character (skill, power, character points, advantage, disadvantage). - * - * @var Thing [schema.org types: Thing] - */ - public $characterAttribute; - /** - * An item is an object within the game world that can be collected by a - * player or, occasionally, a non-player character. - * - * @var Thing [schema.org types: Thing] - */ - public $gameItem; - /** - * Real or fictional location of the game (or part of game). - * - * @var mixed|Place|PostalAddress|string [schema.org types: Place, PostalAddress, URL] - */ - public $gameLocation; - /** - * Indicate how many people can play this game (minimum, maximum, or range). - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfPlayers; - /** - * The task that a player-controlled character, or group of characters may - * complete in order to gain a reward. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $quest; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['characterAttribute', 'gameItem', 'gameLocation', 'numberOfPlayers', 'quest'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GameAvailabilityEnumeration.php b/src/models/jsonld/GameAvailabilityEnumeration.php new file mode 100644 index 000000000..d26ad8fbb --- /dev/null +++ b/src/models/jsonld/GameAvailabilityEnumeration.php @@ -0,0 +1,150 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/GameAvailabilityEnumerationInterface.php b/src/models/jsonld/GameAvailabilityEnumerationInterface.php new file mode 100644 index 000000000..d25d616ee --- /dev/null +++ b/src/models/jsonld/GameAvailabilityEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GamePlayModeInterface.php b/src/models/jsonld/GamePlayModeInterface.php new file mode 100644 index 000000000..2fa257078 --- /dev/null +++ b/src/models/jsonld/GamePlayModeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'game' => ['VideoGame'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'playersOnline' => ['Integer'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'serverStatus' => ['GameServerStatus'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'game', - 'playersOnline', - 'serverStatus' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'game' => ['VideoGame'], - 'playersOnline' => ['Integer'], - 'serverStatus' => ['GameServerStatus'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'game' => 'Video game which is played on this server. Inverse property: gameServer.', - 'playersOnline' => 'Number of players on the server.', - 'serverStatus' => 'Status of a game server.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'game' => 'Video game which is played on this server.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'playersOnline' => 'Number of players on the server.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'serverStatus' => 'Status of a game server.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Video game which is played on this server. Inverse property: gameServer. - * - * @var VideoGame [schema.org types: VideoGame] - */ - public $game; - /** - * Number of players on the server. - * - * @var int [schema.org types: Integer] - */ - public $playersOnline; /** - * Status of a game server. - * - * @var GameServerStatus [schema.org types: GameServerStatus] + * @inheritdoc */ - public $serverStatus; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['game', 'playersOnline', 'serverStatus'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GameServerInterface.php b/src/models/jsonld/GameServerInterface.php new file mode 100644 index 000000000..c085f3c73 --- /dev/null +++ b/src/models/jsonld/GameServerInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GameServerStatusInterface.php b/src/models/jsonld/GameServerStatusInterface.php new file mode 100644 index 000000000..76bde61db --- /dev/null +++ b/src/models/jsonld/GameServerStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GardenStoreInterface.php b/src/models/jsonld/GardenStoreInterface.php new file mode 100644 index 000000000..fa26be92f --- /dev/null +++ b/src/models/jsonld/GardenStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GasStationInterface.php b/src/models/jsonld/GasStationInterface.php new file mode 100644 index 000000000..b0d315246 --- /dev/null +++ b/src/models/jsonld/GasStationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GastroenterologicInterface.php b/src/models/jsonld/GastroenterologicInterface.php new file mode 100644 index 000000000..7f1d0fc54 --- /dev/null +++ b/src/models/jsonld/GastroenterologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'accommodationFloorPlan' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accommodationFloorPlan' => ['FloorPlan'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accommodationFloorPlan' => 'A floorplan of some Accommodation.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A floorplan of some Accommodation. - * - * @var FloorPlan [schema.org types: FloorPlan] + * @inheritdoc */ - public $accommodationFloorPlan; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accommodationFloorPlan'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GatedResidenceCommunityInterface.php b/src/models/jsonld/GatedResidenceCommunityInterface.php new file mode 100644 index 000000000..117a238c7 --- /dev/null +++ b/src/models/jsonld/GatedResidenceCommunityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GenderTypeInterface.php b/src/models/jsonld/GenderTypeInterface.php new file mode 100644 index 000000000..5bf6b2bc8 --- /dev/null +++ b/src/models/jsonld/GenderTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'alternativeOf' => ['Gene'], + 'associatedDisease' => ['URL', 'PropertyValue', 'MedicalCondition'], + 'bioChemInteraction' => ['BioChemEntity'], + 'bioChemSimilarity' => ['BioChemEntity'], + 'biologicalRole' => ['DefinedTerm'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'encodesBioChemEntity' => ['BioChemEntity'], + 'expressedIn' => ['AnatomicalStructure', 'BioChemEntity', 'DefinedTerm', 'AnatomicalSystem'], + 'funding' => ['Grant'], + 'hasBioChemEntityPart' => ['BioChemEntity'], + 'hasBioPolymerSequence' => ['Text'], + 'hasMolecularFunction' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'hasRepresentation' => ['Text', 'PropertyValue', 'URL'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isEncodedByBioChemEntity' => ['Gene'], + 'isInvolvedInBiologicalProcess' => ['PropertyValue', 'URL', 'DefinedTerm'], + 'isLocatedInSubcellularLocation' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'isPartOfBioChemEntity' => ['BioChemEntity'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxonomicRange' => ['URL', 'DefinedTerm', 'Text', 'Taxon'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'alternativeOf' => 'Another gene which is a variation of this one.', + '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.', + 'bioChemInteraction' => 'A BioChemEntity that is known to interact with this item.', + 'bioChemSimilarity' => 'A similar BioChemEntity, e.g., obtained by fingerprint similarity algorithms.', + 'biologicalRole' => 'A role played by the BioChemEntity within a biological context.', + 'description' => 'A description of the item.', + '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.', + 'encodesBioChemEntity' => 'Another BioChemEntity encoded by this one. ', + 'expressedIn' => 'Tissue, organ, biological sample, etc in which activity of this gene has been observed experimentally. For example brain, digestive system.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'hasBioChemEntityPart' => 'Indicates a BioChemEntity that (in some sense) has this BioChemEntity as a part. ', + 'hasBioPolymerSequence' => 'A symbolic representation of a BioChemEnity. For example, a nucleotide sequence of a Gene or an amino acid sequence of a Protein.', + 'hasMolecularFunction' => 'Molecular function performed by this BioChemEntity; please use PropertyValue if you want to include any evidence.', + 'hasRepresentation' => 'A common representation such as a protein sequence or chemical structure for this entity. For images use schema.org/image.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isEncodedByBioChemEntity' => 'Another BioChemEntity encoding by this one.', + 'isInvolvedInBiologicalProcess' => 'Biological process this BioChemEntity is involved in; please use PropertyValue if you want to include any evidence.', + 'isLocatedInSubcellularLocation' => 'Subcellular location where this BioChemEntity is located; please use PropertyValue if you want to include any evidence.', + 'isPartOfBioChemEntity' => 'Indicates a BioChemEntity that is (in some sense) a part of this BioChemEntity. ', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxonomicRange' => 'The taxonomic grouping of the organism that expresses, encodes, or in someway related to the BioChemEntity.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/GeneInterface.php b/src/models/jsonld/GeneInterface.php new file mode 100644 index 000000000..7430355a3 --- /dev/null +++ b/src/models/jsonld/GeneInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GeneralContractorInterface.php b/src/models/jsonld/GeneralContractorInterface.php new file mode 100644 index 000000000..348252781 --- /dev/null +++ b/src/models/jsonld/GeneralContractorInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/GenericWebPlatformInterface.php b/src/models/jsonld/GenericWebPlatformInterface.php new file mode 100644 index 000000000..c37732a5b --- /dev/null +++ b/src/models/jsonld/GenericWebPlatformInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GeneticInterface.php b/src/models/jsonld/GeneticInterface.php new file mode 100644 index 000000000..46383f54a --- /dev/null +++ b/src/models/jsonld/GeneticInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GenitourinaryInterface.php b/src/models/jsonld/GenitourinaryInterface.php new file mode 100644 index 000000000..2f6b68e39 --- /dev/null +++ b/src/models/jsonld/GenitourinaryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'addressCountry' => ['Country', 'Text'], + 'alternateName' => ['Text'], + 'box' => ['Text'], + 'circle' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'elevation' => ['Text', 'Number'], + 'geoMidpoint' => ['GeoCoordinates'], + 'geoRadius' => ['Number', 'Text', 'Distance'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'line' => ['Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'polygon' => ['Text'], + 'postalCode' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'geoMidpoint', - 'geoRadius' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'geoMidpoint' => ['GeoCoordinates'], - 'geoRadius' => ['Distance', 'Number', 'Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'address' => 'Physical address of the item.', + '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).', + 'alternateName' => 'An alias for the item.', + '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.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'geoMidpoint' => 'Indicates the GeoCoordinates at the centre of a GeoShape e.g. GeoCircle.', + 'geoRadius' => 'Indicates the approximate radius of a GeoCircle (metres unless indicated otherwise via Distance notation).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + '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.', + 'name' => 'The name of the item.', + '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.', + 'postalCode' => 'The postal code. For example, 94043.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'geoMidpoint' => 'Indicates the GeoCoordinates at the centre of a GeoShape e.g. GeoCircle.', - 'geoRadius' => 'Indicates the approximate radius of a GeoCircle (metres unless indicated otherwise via Distance notation).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the GeoCoordinates at the centre of a GeoShape e.g. GeoCircle. - * - * @var GeoCoordinates [schema.org types: GeoCoordinates] - */ - public $geoMidpoint; - /** - * Indicates the approximate radius of a GeoCircle (metres unless indicated - * otherwise via Distance notation). - * - * @var mixed|Distance|float|string [schema.org types: Distance, Number, Text] + * @inheritdoc */ - public $geoRadius; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['geoMidpoint', 'geoRadius'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GeoCircleInterface.php b/src/models/jsonld/GeoCircleInterface.php new file mode 100644 index 000000000..169a063c0 --- /dev/null +++ b/src/models/jsonld/GeoCircleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'addressCountry' => ['Country', 'Text'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'elevation' => ['Text', 'Number'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'latitude' => ['Text', 'Number'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'postalCode' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'address', - 'addressCountry', - 'elevation', - 'latitude', - 'longitude', - 'postalCode' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'address' => ['PostalAddress', 'Text'], - 'addressCountry' => ['Country', 'Text'], - 'elevation' => ['Number', 'Text'], - 'latitude' => ['Number', 'Text'], - 'longitude' => ['Number', 'Text'], - 'postalCode' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'address' => 'Physical address of the item.', - 'addressCountry' => 'The country. For example, USA. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', - 'elevation' => 'The elevation of a location (WGS 84). Values may be of the form \'NUMBER UNITOFMEASUREMENT\' (e.g., \'1,000 m\', \'3,200 ft\') while numbers alone should be assumed to be a value in meters.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'postalCode' => 'The postal code. For example, 94043.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] + * @inheritdoc */ - public $address; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'address' => 'Physical address of the item.', + '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).', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'name' => 'The name of the item.', + 'postalCode' => 'The postal code. For example, 94043.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The country. For example, USA. You can also provide the two-letter ISO - * 3166-1 alpha-2 country code. - * - * @var mixed|Country|string [schema.org types: Country, Text] - */ - public $addressCountry; /** - * The elevation of a location (WGS 84). Values may be of the form 'NUMBER - * UNITOFMEASUREMENT' (e.g., '1,000 m', '3,200 ft') while numbers alone should - * be assumed to be a value in meters. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $elevation; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The postal code. For example, 94043. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $postalCode; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['address', 'addressCountry', 'elevation', 'latitude', 'longitude', 'postalCode'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GeoCoordinatesInterface.php b/src/models/jsonld/GeoCoordinatesInterface.php new file mode 100644 index 000000000..0137b52bd --- /dev/null +++ b/src/models/jsonld/GeoCoordinatesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'addressCountry' => ['Country', 'Text'], + 'alternateName' => ['Text'], + 'box' => ['Text'], + 'circle' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'elevation' => ['Text', 'Number'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'line' => ['Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'polygon' => ['Text'], + 'postalCode' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'address', - 'addressCountry', - 'box', - 'circle', - 'elevation', - 'line', - 'polygon', - 'postalCode' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'address' => ['PostalAddress', 'Text'], - 'addressCountry' => ['Country', 'Text'], - 'box' => ['Text'], - 'circle' => ['Text'], - 'elevation' => ['Number', 'Text'], - 'line' => ['Text'], - 'polygon' => ['Text'], - 'postalCode' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'address' => 'Physical address of the item.', - 'addressCountry' => 'The country. For example, USA. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', - '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.', - '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.', - 'elevation' => 'The elevation of a location (WGS 84). Values may be of the form \'NUMBER UNITOFMEASUREMENT\' (e.g., \'1,000 m\', \'3,200 ft\') while numbers alone should be assumed to be a value in meters.', - '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.', - '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.', - 'postalCode' => 'The postal code. For example, 94043.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The country. For example, USA. You can also provide the two-letter ISO - * 3166-1 alpha-2 country code. - * - * @var mixed|Country|string [schema.org types: Country, Text] - */ - public $addressCountry; - /** - * 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. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $box; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'address' => 'Physical address of the item.', + '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).', + 'alternateName' => 'An alias for the item.', + '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.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + '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.', + 'name' => 'The name of the item.', + '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.', + 'postalCode' => 'The postal code. For example, 94043.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $circle; - /** - * The elevation of a location (WGS 84). Values may be of the form 'NUMBER - * UNITOFMEASUREMENT' (e.g., '1,000 m', '3,200 ft') while numbers alone should - * be assumed to be a value in meters. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $elevation; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $line; /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $polygon; - /** - * The postal code. For example, 94043. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $postalCode; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['address', 'addressCountry', 'box', 'circle', 'elevation', 'line', 'polygon', 'postalCode'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GeoShapeInterface.php b/src/models/jsonld/GeoShapeInterface.php new file mode 100644 index 000000000..7ebe43b69 --- /dev/null +++ b/src/models/jsonld/GeoShapeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] + * @inheritdoc */ - public $geoDisjoint; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] + * @inheritdoc */ - public $geoWithin; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GeospatialGeometryInterface.php b/src/models/jsonld/GeospatialGeometryInterface.php new file mode 100644 index 000000000..3db73413b --- /dev/null +++ b/src/models/jsonld/GeospatialGeometryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GeriatricInterface.php b/src/models/jsonld/GeriatricInterface.php new file mode 100644 index 000000000..2c1b70c0c --- /dev/null +++ b/src/models/jsonld/GeriatricInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/GettingAccessHealthAspectInterface.php b/src/models/jsonld/GettingAccessHealthAspectInterface.php new file mode 100644 index 000000000..8e282f154 --- /dev/null +++ b/src/models/jsonld/GettingAccessHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'recipient' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GiveActionInterface.php b/src/models/jsonld/GiveActionInterface.php new file mode 100644 index 000000000..ca77c5358 --- /dev/null +++ b/src/models/jsonld/GiveActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GlutenFreeDietInterface.php b/src/models/jsonld/GlutenFreeDietInterface.php new file mode 100644 index 000000000..49fa57ac3 --- /dev/null +++ b/src/models/jsonld/GlutenFreeDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GolfCourseInterface.php b/src/models/jsonld/GolfCourseInterface.php new file mode 100644 index 000000000..aed57265d --- /dev/null +++ b/src/models/jsonld/GolfCourseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/GovernmentBenefitsTypeInterface.php b/src/models/jsonld/GovernmentBenefitsTypeInterface.php new file mode 100644 index 000000000..ff0b37c47 --- /dev/null +++ b/src/models/jsonld/GovernmentBenefitsTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GovernmentBuildingInterface.php b/src/models/jsonld/GovernmentBuildingInterface.php new file mode 100644 index 000000000..7c1ad898d --- /dev/null +++ b/src/models/jsonld/GovernmentBuildingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GovernmentOfficeInterface.php b/src/models/jsonld/GovernmentOfficeInterface.php new file mode 100644 index 000000000..26d561f76 --- /dev/null +++ b/src/models/jsonld/GovernmentOfficeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GovernmentOrganizationInterface.php b/src/models/jsonld/GovernmentOrganizationInterface.php new file mode 100644 index 000000000..d4d38c947 --- /dev/null +++ b/src/models/jsonld/GovernmentOrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'issuedBy' => ['Organization'], + 'issuedThrough' => ['Service'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'permitAudience' => ['Audience'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFor' => ['Duration'], + 'validFrom' => ['DateTime', 'Date'], + 'validIn' => ['AdministrativeArea'], + 'validUntil' => ['Date'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'issuedBy', - 'issuedThrough', - 'permitAudience', - 'validFor', - 'validFrom', - 'validIn', - 'validUntil' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'issuedBy' => ['Organization'], - 'issuedThrough' => ['Service'], - 'permitAudience' => ['Audience'], - 'validFor' => ['Duration'], - 'validFrom' => ['Date', 'DateTime'], - 'validIn' => ['AdministrativeArea'], - 'validUntil' => ['Date'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'issuedBy' => 'The organization issuing the ticket or permit.', - 'issuedThrough' => 'The service through with the permit was granted.', - 'permitAudience' => 'The target audience for this permit.', - 'validFor' => 'The duration of validity of a permit or similar thing.', - 'validFrom' => 'The date when the item becomes valid.', - 'validIn' => 'The geographic area where a permit or similar thing is valid.', - 'validUntil' => 'The date when the item is no longer valid.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The organization issuing the ticket or permit. - * - * @var Organization [schema.org types: Organization] - */ - public $issuedBy; - /** - * The service through with the permit was granted. - * - * @var Service [schema.org types: Service] + * @inheritdoc */ - public $issuedThrough; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'issuedBy' => 'The organization issuing the ticket or permit.', + 'issuedThrough' => 'The service through with the permit was granted.', + '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.', + 'name' => 'The name of the item.', + 'permitAudience' => 'The target audience for this permit.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFor' => 'The duration of validity of a permit or similar thing.', + 'validFrom' => 'The date when the item becomes valid.', + 'validIn' => 'The geographic area where a permit or similar thing is valid.', + 'validUntil' => 'The date when the item is no longer valid.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The target audience for this permit. - * - * @var Audience [schema.org types: Audience] - */ - public $permitAudience; - /** - * The duration of validity of a permit or similar thing. - * - * @var Duration [schema.org types: Duration] - */ - public $validFor; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; - /** - * The geographic area where a permit or similar thing is valid. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] - */ - public $validIn; /** - * The date when the item is no longer valid. - * - * @var Date [schema.org types: Date] + * @inheritdoc */ - public $validUntil; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['issuedBy', 'issuedThrough', 'permitAudience', 'validFor', 'validFrom', 'validIn', 'validUntil'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GovernmentPermitInterface.php b/src/models/jsonld/GovernmentPermitInterface.php new file mode 100644 index 000000000..e43fb7725 --- /dev/null +++ b/src/models/jsonld/GovernmentPermitInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'jurisdiction' => ['Text', 'AdministrativeArea'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOperator' => ['Organization'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'serviceOperator' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'jurisdiction' => 'Indicates a legal jurisdiction, e.g. of some legislation, or where some government service is based.', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOperator' => 'The operating organization, if different from the provider. This enables the representation of services that are provided by an organization, but operated by another organization like a subcontractor.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'serviceOperator' => ['Organization'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'serviceOperator' => 'The operating organization, if different from the provider. This enables the representation of services that are provided by an organization, but operated by another organization like a subcontractor.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The operating organization, if different from the provider. This enables - * the representation of services that are provided by an organization, but - * operated by another organization like a subcontractor. - * - * @var Organization [schema.org types: Organization] + * @inheritdoc */ - public $serviceOperator; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['serviceOperator'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GovernmentServiceInterface.php b/src/models/jsonld/GovernmentServiceInterface.php new file mode 100644 index 000000000..99e5abeb9 --- /dev/null +++ b/src/models/jsonld/GovernmentServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'fundedItem', - 'sponsor' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'fundedItem' => ['Thing'], - 'sponsor' => ['Organization', 'Person'] - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'fundedItem' => ['Product', 'Person', 'BioChemEntity', 'Event', 'MedicalEntity', 'CreativeWork', 'Organization'], + 'funder' => ['Organization', 'Person'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'fundedItem' => 'Indicates an item funded or sponsored through a Grant.', - '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.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates an item funded or sponsored through a Grant. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $fundedItem; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'fundedItem' => 'Indicates something directly or indirectly funded or sponsored through a [[Grant]]. See also [[ownershipFundingInfo]].', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['fundedItem', 'sponsor'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GrantInterface.php b/src/models/jsonld/GrantInterface.php new file mode 100644 index 000000000..ebe0a7e0b --- /dev/null +++ b/src/models/jsonld/GrantInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GraphicNovelInterface.php b/src/models/jsonld/GraphicNovelInterface.php new file mode 100644 index 000000000..f014001aa --- /dev/null +++ b/src/models/jsonld/GraphicNovelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GroceryStoreInterface.php b/src/models/jsonld/GroceryStoreInterface.php new file mode 100644 index 000000000..9160e9234 --- /dev/null +++ b/src/models/jsonld/GroceryStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GroupBoardingPolicyInterface.php b/src/models/jsonld/GroupBoardingPolicyInterface.php new file mode 100644 index 000000000..303bdcb32 --- /dev/null +++ b/src/models/jsonld/GroupBoardingPolicyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewAspect' => ['Text'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'reviewAspect' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'reviewAspect' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * This Review or Rating is relevant to this part or facet of the - * itemReviewed. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $reviewAspect; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['reviewAspect'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GuideInterface.php b/src/models/jsonld/GuideInterface.php new file mode 100644 index 000000000..b99197cdf --- /dev/null +++ b/src/models/jsonld/GuideInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/GynecologicInterface.php b/src/models/jsonld/GynecologicInterface.php new file mode 100644 index 000000000..04b1cf133 --- /dev/null +++ b/src/models/jsonld/GynecologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HVACBusinessInterface.php b/src/models/jsonld/HVACBusinessInterface.php new file mode 100644 index 000000000..1b1b79117 --- /dev/null +++ b/src/models/jsonld/HVACBusinessInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/HackathonInterface.php b/src/models/jsonld/HackathonInterface.php new file mode 100644 index 000000000..c2ab163e1 --- /dev/null +++ b/src/models/jsonld/HackathonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HairSalonInterface.php b/src/models/jsonld/HairSalonInterface.php new file mode 100644 index 000000000..6da7b497b --- /dev/null +++ b/src/models/jsonld/HairSalonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HalalDietInterface.php b/src/models/jsonld/HalalDietInterface.php new file mode 100644 index 000000000..afdfba008 --- /dev/null +++ b/src/models/jsonld/HalalDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HardcoverInterface.php b/src/models/jsonld/HardcoverInterface.php new file mode 100644 index 000000000..6f090e66b --- /dev/null +++ b/src/models/jsonld/HardcoverInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HardwareStoreInterface.php b/src/models/jsonld/HardwareStoreInterface.php new file mode 100644 index 000000000..0fbf932c6 --- /dev/null +++ b/src/models/jsonld/HardwareStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HeadInterface.php b/src/models/jsonld/HeadInterface.php new file mode 100644 index 000000000..94667d696 --- /dev/null +++ b/src/models/jsonld/HeadInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HealthAndBeautyBusinessInterface.php b/src/models/jsonld/HealthAndBeautyBusinessInterface.php new file mode 100644 index 000000000..f941f1ad3 --- /dev/null +++ b/src/models/jsonld/HealthAndBeautyBusinessInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HealthAspectEnumerationInterface.php b/src/models/jsonld/HealthAspectEnumerationInterface.php new file mode 100644 index 000000000..43577f55e --- /dev/null +++ b/src/models/jsonld/HealthAspectEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/HealthCareInterface.php b/src/models/jsonld/HealthCareInterface.php new file mode 100644 index 000000000..8d0baf2c4 --- /dev/null +++ b/src/models/jsonld/HealthCareInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HealthClubInterface.php b/src/models/jsonld/HealthClubInterface.php new file mode 100644 index 000000000..8b9a75ba6 --- /dev/null +++ b/src/models/jsonld/HealthClubInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'benefitsSummaryUrl' => ['URL'], + 'contactPoint' => ['ContactPoint'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'healthPlanDrugOption' => ['Text'], + 'healthPlanDrugTier' => ['Text'], + 'healthPlanId' => ['Text'], + 'healthPlanMarketingUrl' => ['URL'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includesHealthPlanFormulary' => ['HealthPlanFormulary'], + 'includesHealthPlanNetwork' => ['HealthPlanNetwork'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'usesHealthPlanIdStandard' => ['URL', 'Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'benefitsSummaryUrl', - 'contactPoint', - 'healthPlanDrugOption', - 'healthPlanDrugTier', - 'healthPlanId', - 'healthPlanMarketingUrl', - 'includesHealthPlanFormulary', - 'includesHealthPlanNetwork', - 'usesHealthPlanIdStandard' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'benefitsSummaryUrl' => ['URL'], - 'contactPoint' => ['ContactPoint'], - 'healthPlanDrugOption' => ['Text'], - 'healthPlanDrugTier' => ['Text'], - 'healthPlanId' => ['Text'], - 'healthPlanMarketingUrl' => ['URL'], - 'includesHealthPlanFormulary' => ['HealthPlanFormulary'], - 'includesHealthPlanNetwork' => ['HealthPlanNetwork'], - 'usesHealthPlanIdStandard' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'benefitsSummaryUrl' => 'The URL that goes directly to the summary of benefits and coverage for the specific standard plan or plan variation.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'healthPlanDrugOption' => 'TODO.', - 'healthPlanDrugTier' => 'The tier(s) of drugs offered by this formulary or insurance plan.', - 'healthPlanId' => 'The 14-character, HIOS-generated Plan ID number. (Plan IDs must be unique, even across different markets.)', - 'healthPlanMarketingUrl' => 'The URL that goes directly to the plan brochure for the specific standard plan or plan variation.', - 'includesHealthPlanFormulary' => 'Formularies covered by this plan.', - 'includesHealthPlanNetwork' => 'Networks covered by this plan.', - 'usesHealthPlanIdStandard' => 'The standard for interpreting thePlan ID. The preferred is "HIOS". See the Centers for Medicare & Medicaid Services for more details.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The URL that goes directly to the summary of benefits and coverage for the - * specific standard plan or plan variation. - * - * @var string [schema.org types: URL] - */ - public $benefitsSummaryUrl; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * TODO. - * - * @var string [schema.org types: Text] - */ - public $healthPlanDrugOption; - /** - * The tier(s) of drugs offered by this formulary or insurance plan. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $healthPlanDrugTier; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'benefitsSummaryUrl' => 'The URL that goes directly to the summary of benefits and coverage for the specific standard plan or plan variation.', + 'contactPoint' => 'A contact point for a person or organization.', + 'description' => 'A description of the item.', + '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.', + 'healthPlanDrugOption' => 'TODO.', + 'healthPlanDrugTier' => 'The tier(s) of drugs offered by this formulary or insurance plan.', + 'healthPlanId' => 'The 14-character, HIOS-generated Plan ID number. (Plan IDs must be unique, even across different markets.)', + 'healthPlanMarketingUrl' => 'The URL that goes directly to the plan brochure for the specific standard plan or plan variation.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includesHealthPlanFormulary' => 'Formularies covered by this plan.', + 'includesHealthPlanNetwork' => 'Networks covered by this plan.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'usesHealthPlanIdStandard' => 'The standard for interpreting thePlan ID. The preferred is "HIOS". See the Centers for Medicare & Medicaid Services for more details.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The 14-character, HIOS-generated Plan ID number. (Plan IDs must be unique, - * even across different markets.) - * - * @var string [schema.org types: Text] - */ - public $healthPlanId; - /** - * The URL that goes directly to the plan brochure for the specific standard - * plan or plan variation. - * - * @var string [schema.org types: URL] - */ - public $healthPlanMarketingUrl; - /** - * Formularies covered by this plan. - * - * @var HealthPlanFormulary [schema.org types: HealthPlanFormulary] - */ - public $includesHealthPlanFormulary; - /** - * Networks covered by this plan. - * - * @var HealthPlanNetwork [schema.org types: HealthPlanNetwork] - */ - public $includesHealthPlanNetwork; - /** - * The standard for interpreting thePlan ID. The preferred is "HIOS". See the - * Centers for Medicare & Medicaid Services for more details. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $usesHealthPlanIdStandard; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['benefitsSummaryUrl', 'contactPoint', 'healthPlanDrugOption', 'healthPlanDrugTier', 'healthPlanId', 'healthPlanMarketingUrl', 'includesHealthPlanFormulary', 'includesHealthPlanNetwork', 'usesHealthPlanIdStandard'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HealthInsurancePlanInterface.php b/src/models/jsonld/HealthInsurancePlanInterface.php new file mode 100644 index 000000000..563461f33 --- /dev/null +++ b/src/models/jsonld/HealthInsurancePlanInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'healthPlanCoinsuranceOption' => ['Text'], + 'healthPlanCoinsuranceRate' => ['Number'], + 'healthPlanCopay' => ['PriceSpecification'], + 'healthPlanCopayOption' => ['Text'], + 'healthPlanPharmacyCategory' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'healthPlanCoinsuranceOption', - 'healthPlanCoinsuranceRate', - 'healthPlanCopay', - 'healthPlanCopayOption', - 'healthPlanPharmacyCategory' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'healthPlanCoinsuranceOption' => ['Text'], - 'healthPlanCoinsuranceRate' => ['Number'], - 'healthPlanCopay' => ['PriceSpecification'], - 'healthPlanCopayOption' => ['Text'], - 'healthPlanPharmacyCategory' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'healthPlanCoinsuranceOption' => 'Whether the coinsurance applies before or after deductible, etc. TODO: Is this a closed set?', - 'healthPlanCoinsuranceRate' => 'Whether The rate of coinsurance expressed as a number between 0.0 and 1.0.', - 'healthPlanCopay' => 'Whether The copay amount.', - 'healthPlanCopayOption' => 'Whether the copay is before or after deductible, etc. TODO: Is this a closed set?', - 'healthPlanPharmacyCategory' => 'The category or type of pharmacy associated with this cost sharing.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'healthPlanCoinsuranceOption' => 'Whether the coinsurance applies before or after deductible, etc. TODO: Is this a closed set?', + 'healthPlanCoinsuranceRate' => 'Whether The rate of coinsurance expressed as a number between 0.0 and 1.0.', + 'healthPlanCopay' => 'Whether The copay amount.', + 'healthPlanCopayOption' => 'Whether the copay is before or after deductible, etc. TODO: Is this a closed set?', + 'healthPlanPharmacyCategory' => 'The category or type of pharmacy associated with this cost sharing.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * Whether the coinsurance applies before or after deductible, etc. TODO: Is - * this a closed set? - * - * @var string [schema.org types: Text] - */ - public $healthPlanCoinsuranceOption; - /** - * Whether The rate of coinsurance expressed as a number between 0.0 and 1.0. - * - * @var float [schema.org types: Number] - */ - public $healthPlanCoinsuranceRate; - /** - * Whether The copay amount. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $healthPlanCopay; - /** - * Whether the copay is before or after deductible, etc. TODO: Is this a - * closed set? - * - * @var string [schema.org types: Text] - */ - public $healthPlanCopayOption; - /** - * The category or type of pharmacy associated with this cost sharing. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $healthPlanPharmacyCategory; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['healthPlanCoinsuranceOption', 'healthPlanCoinsuranceRate', 'healthPlanCopay', 'healthPlanCopayOption', 'healthPlanPharmacyCategory'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HealthPlanCostSharingSpecificationInterface.php b/src/models/jsonld/HealthPlanCostSharingSpecificationInterface.php new file mode 100644 index 000000000..637b8c987 --- /dev/null +++ b/src/models/jsonld/HealthPlanCostSharingSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'healthPlanCostSharing' => ['Boolean'], + 'healthPlanDrugTier' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offersPrescriptionByMail' => ['Boolean'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'healthPlanCostSharing', - 'healthPlanDrugTier', - 'offersPrescriptionByMail' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'healthPlanCostSharing' => ['Boolean'], - 'healthPlanDrugTier' => ['Text'], - 'offersPrescriptionByMail' => ['Boolean'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'healthPlanCostSharing' => 'Whether The costs to the patient for services under this network or formulary.', - 'healthPlanDrugTier' => 'The tier(s) of drugs offered by this formulary or insurance plan.', - 'offersPrescriptionByMail' => 'Whether prescriptions can be delivered by mail.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'healthPlanCostSharing' => 'Whether The costs to the patient for services under this network or formulary.', + 'healthPlanDrugTier' => 'The tier(s) of drugs offered by this formulary or insurance plan.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'offersPrescriptionByMail' => 'Whether prescriptions can be delivered by mail.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Whether The costs to the patient for services under this network or - * formulary. - * - * @var bool [schema.org types: Boolean] - */ - public $healthPlanCostSharing; - /** - * The tier(s) of drugs offered by this formulary or insurance plan. - * - * @var string [schema.org types: Text] - */ - public $healthPlanDrugTier; /** - * Whether prescriptions can be delivered by mail. - * - * @var bool [schema.org types: Boolean] + * @inheritdoc */ - public $offersPrescriptionByMail; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['healthPlanCostSharing', 'healthPlanDrugTier', 'offersPrescriptionByMail'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HealthPlanFormularyInterface.php b/src/models/jsonld/HealthPlanFormularyInterface.php new file mode 100644 index 000000000..6a9be0f8e --- /dev/null +++ b/src/models/jsonld/HealthPlanFormularyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'healthPlanCostSharing' => ['Boolean'], + 'healthPlanNetworkId' => ['Text'], + 'healthPlanNetworkTier' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'healthPlanCostSharing', - 'healthPlanNetworkId', - 'healthPlanNetworkTier' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'healthPlanCostSharing' => ['Boolean'], - 'healthPlanNetworkId' => ['Text'], - 'healthPlanNetworkTier' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'healthPlanCostSharing' => 'Whether The costs to the patient for services under this network or formulary.', - 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', - 'healthPlanNetworkTier' => 'The tier(s) for this network.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'healthPlanCostSharing' => 'Whether The costs to the patient for services under this network or formulary.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + 'healthPlanNetworkTier' => 'The tier(s) for this network.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Whether The costs to the patient for services under this network or - * formulary. - * - * @var bool [schema.org types: Boolean] - */ - public $healthPlanCostSharing; - /** - * Name or unique ID of network. (Networks are often reused across different - * insurance plans). - * - * @var string [schema.org types: Text] - */ - public $healthPlanNetworkId; /** - * The tier(s) for this network. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $healthPlanNetworkTier; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['healthPlanCostSharing', 'healthPlanNetworkId', 'healthPlanNetworkTier'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HealthPlanNetworkInterface.php b/src/models/jsonld/HealthPlanNetworkInterface.php new file mode 100644 index 000000000..6cba46f23 --- /dev/null +++ b/src/models/jsonld/HealthPlanNetworkInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasHealthAspect' => ['HealthAspectEnumeration'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'hasHealthAspect' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasHealthAspect' => 'Indicates the aspect or aspects specifically addressed in some [[HealthTopicContent]]. For example, that the content is an overview, or that it talks about treatment, self-care, treatments or their side-effects.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasHealthAspect' => ['HealthAspectEnumeration'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasHealthAspect' => 'Indicates the aspect or aspects specifically addressed in some HealthTopicContent. For example, that the content is an overview, or that it talks about treatment, self-care, treatments or their side-effects.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the aspect or aspects specifically addressed in some - * HealthTopicContent. For example, that the content is an overview, or that - * it talks about treatment, self-care, treatments or their side-effects. - * - * @var HealthAspectEnumeration [schema.org types: HealthAspectEnumeration] + * @inheritdoc */ - public $hasHealthAspect; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasHealthAspect'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HealthTopicContentInterface.php b/src/models/jsonld/HealthTopicContentInterface.php new file mode 100644 index 000000000..a1da6ba00 --- /dev/null +++ b/src/models/jsonld/HealthTopicContentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/HealthcareConsiderationInterface.php b/src/models/jsonld/HealthcareConsiderationInterface.php new file mode 100644 index 000000000..1172253f8 --- /dev/null +++ b/src/models/jsonld/HealthcareConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HearingImpairedSupportedInterface.php b/src/models/jsonld/HearingImpairedSupportedInterface.php new file mode 100644 index 000000000..a7893f06b --- /dev/null +++ b/src/models/jsonld/HearingImpairedSupportedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HematologicInterface.php b/src/models/jsonld/HematologicInterface.php new file mode 100644 index 000000000..11d9624de --- /dev/null +++ b/src/models/jsonld/HematologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'alumni' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'alumni' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $alumni; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['alumni'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HighSchoolInterface.php b/src/models/jsonld/HighSchoolInterface.php new file mode 100644 index 000000000..eef37ba7a --- /dev/null +++ b/src/models/jsonld/HighSchoolInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HinduDietInterface.php b/src/models/jsonld/HinduDietInterface.php new file mode 100644 index 000000000..4cb31766e --- /dev/null +++ b/src/models/jsonld/HinduDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HinduTempleInterface.php b/src/models/jsonld/HinduTempleInterface.php new file mode 100644 index 000000000..3b3afa501 --- /dev/null +++ b/src/models/jsonld/HinduTempleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HobbyShopInterface.php b/src/models/jsonld/HobbyShopInterface.php new file mode 100644 index 000000000..bd2d47ffe --- /dev/null +++ b/src/models/jsonld/HobbyShopInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HomeAndConstructionBusinessInterface.php b/src/models/jsonld/HomeAndConstructionBusinessInterface.php new file mode 100644 index 000000000..6d8b48830 --- /dev/null +++ b/src/models/jsonld/HomeAndConstructionBusinessInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HomeGoodsStoreInterface.php b/src/models/jsonld/HomeGoodsStoreInterface.php new file mode 100644 index 000000000..665df5e5a --- /dev/null +++ b/src/models/jsonld/HomeGoodsStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HomeopathicInterface.php b/src/models/jsonld/HomeopathicInterface.php new file mode 100644 index 000000000..8a338c53b --- /dev/null +++ b/src/models/jsonld/HomeopathicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availableService' => ['MedicalTest', 'MedicalProcedure', 'MedicalTherapy'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthPlanNetworkId' => ['Text'], + 'healthcareReportingData' => ['Dataset', 'CDCPMDRecord'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAcceptingNewPatients' => ['Boolean'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'medicalSpecialty' => ['MedicalSpecialty'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'availableService', - 'healthcareReportingData', - 'medicalSpecialty' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'availableService' => ['MedicalProcedure', 'MedicalTest', 'MedicalTherapy'], - 'healthcareReportingData' => ['CDCPMDRecord', 'Dataset'], - 'medicalSpecialty' => ['MedicalSpecialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'availableService' => 'A medical service available from this provider.', - 'healthcareReportingData' => 'Indicates data describing a hospital, e.g. a CDC CDCPMDRecord or as some kind of Dataset.', - 'medicalSpecialty' => 'A medical specialty of the provider.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availableService' => 'A medical service available from this provider.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + 'healthcareReportingData' => 'Indicates data describing a hospital, e.g. a CDC [[CDCPMDRecord]] or as some kind of [[Dataset]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'medicalSpecialty' => 'A medical specialty of the provider.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical service available from this provider. - * - * @var mixed|MedicalProcedure|MedicalTest|MedicalTherapy [schema.org types: MedicalProcedure, MedicalTest, MedicalTherapy] - */ - public $availableService; - /** - * Indicates data describing a hospital, e.g. a CDC CDCPMDRecord or as some - * kind of Dataset. - * - * @var mixed|CDCPMDRecord|Dataset [schema.org types: CDCPMDRecord, Dataset] - */ - public $healthcareReportingData; /** - * A medical specialty of the provider. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] + * @inheritdoc */ - public $medicalSpecialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['availableService', 'healthcareReportingData', 'medicalSpecialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HospitalInterface.php b/src/models/jsonld/HospitalInterface.php new file mode 100644 index 000000000..f89a04dbb --- /dev/null +++ b/src/models/jsonld/HospitalInterface.php @@ -0,0 +1,24 @@ +dedicated document on the use of schema.org + * for marking up hotels and other forms of accommodations. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Hostel + * @see https://schema.org/Hostel */ -class Hostel extends LodgingBusiness +class Hostel extends MetaJsonLd implements HostelInterface, LodgingBusinessInterface, LocalBusinessInterface, OrganizationInterface, ThingInterface, PlaceInterface { // Static Public Properties // ========================================================================= @@ -33,235 +33,339 @@ class Hostel extends LodgingBusiness * * @var string */ - static public $schemaTypeName = 'Hostel'; + static public string $schemaTypeName = 'Hostel'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Hostel'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'A hostel - cheap accommodation, often in shared dormitories. See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/Hostel'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'LodgingBusiness'; + static public string $schemaTypeExtends = 'LodgingBusiness'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<
+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use HostelTrait; + use LodgingBusinessTrait; + use LocalBusinessTrait; + use OrganizationTrait; + use ThingTrait; + use PlaceTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableLanguage' => ['Text', 'Language'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'checkinTime' => ['DateTime', 'Time'], + 'checkoutTime' => ['DateTime', 'Time'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amenityFeature', - 'audience', - 'availableLanguage', - 'checkinTime', - 'checkoutTime', - 'numberOfRooms', - 'petsAllowed', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amenityFeature' => ['LocationFeatureSpecification'], - 'audience' => ['Audience'], - 'availableLanguage' => ['Language', 'Text'], - 'checkinTime' => ['DateTime', 'Time'], - 'checkoutTime' => ['DateTime', 'Time'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'petsAllowed' => ['Boolean', 'Text'], - 'starRating' => ['Rating'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. See also inLanguage', - 'checkinTime' => 'The earliest someone may check into a lodging establishment.', - 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A language someone may use with or at the item, service or place. Please - * use one of the language codes from the IETF BCP 47 standard. See also - * inLanguage - * - * @var mixed|Language|string [schema.org types: Language, Text] + * @inheritdoc */ - public $availableLanguage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'checkinTime' => 'The earliest someone may check into a lodging establishment.', + 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The earliest someone may check into a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkinTime; - /** - * The latest someone may check out of a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkoutTime; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; - /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amenityFeature', 'audience', 'availableLanguage', 'checkinTime', 'checkoutTime', 'numberOfRooms', 'petsAllowed', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HostelInterface.php b/src/models/jsonld/HostelInterface.php new file mode 100644 index 000000000..c38dd94f6 --- /dev/null +++ b/src/models/jsonld/HostelInterface.php @@ -0,0 +1,24 @@ +dedicated document on the use of schema.org for + * marking up hotels and other forms of accommodations. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Hotel + * @see https://schema.org/Hotel */ -class Hotel extends LodgingBusiness +class Hotel extends MetaJsonLd implements HotelInterface, LodgingBusinessInterface, LocalBusinessInterface, OrganizationInterface, ThingInterface, PlaceInterface { // Static Public Properties // ========================================================================= @@ -34,235 +35,339 @@ class Hotel extends LodgingBusiness * * @var string */ - static public $schemaTypeName = 'Hotel'; + static public string $schemaTypeName = 'Hotel'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Hotel'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'A hotel is an establishment that provides lodging paid on a short-term basis (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Hotel). See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/Hotel'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'LodgingBusiness'; + static public string $schemaTypeExtends = 'LodgingBusiness'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<
+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use HotelTrait; + use LodgingBusinessTrait; + use LocalBusinessTrait; + use OrganizationTrait; + use ThingTrait; + use PlaceTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableLanguage' => ['Text', 'Language'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'checkinTime' => ['DateTime', 'Time'], + 'checkoutTime' => ['DateTime', 'Time'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amenityFeature', - 'audience', - 'availableLanguage', - 'checkinTime', - 'checkoutTime', - 'numberOfRooms', - 'petsAllowed', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amenityFeature' => ['LocationFeatureSpecification'], - 'audience' => ['Audience'], - 'availableLanguage' => ['Language', 'Text'], - 'checkinTime' => ['DateTime', 'Time'], - 'checkoutTime' => ['DateTime', 'Time'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'petsAllowed' => ['Boolean', 'Text'], - 'starRating' => ['Rating'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. See also inLanguage', - 'checkinTime' => 'The earliest someone may check into a lodging establishment.', - 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A language someone may use with or at the item, service or place. Please - * use one of the language codes from the IETF BCP 47 standard. See also - * inLanguage - * - * @var mixed|Language|string [schema.org types: Language, Text] + * @inheritdoc */ - public $availableLanguage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'checkinTime' => 'The earliest someone may check into a lodging establishment.', + 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The earliest someone may check into a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkinTime; - /** - * The latest someone may check out of a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkoutTime; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; - /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amenityFeature', 'audience', 'availableLanguage', 'checkinTime', 'checkoutTime', 'numberOfRooms', 'petsAllowed', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HotelInterface.php b/src/models/jsonld/HotelInterface.php new file mode 100644 index 000000000..f4a4c4e47 --- /dev/null +++ b/src/models/jsonld/HotelInterface.php @@ -0,0 +1,24 @@ +dedicated document on the use of schema.org for + * marking up hotels and other forms of accommodations. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/HotelRoom + * @see https://schema.org/HotelRoom */ -class HotelRoom extends Room +class HotelRoom extends MetaJsonLd implements HotelRoomInterface, RoomInterface, AccommodationInterface, PlaceInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -33,175 +33,238 @@ class HotelRoom extends Room * * @var string */ - static public $schemaTypeName = 'HotelRoom'; + static public string $schemaTypeName = 'HotelRoom'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/HotelRoom'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'A hotel room is a single room in a hotel. See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/HotelRoom'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Room'; + static public string $schemaTypeExtends = 'Room'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<
+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use HotelRoomTrait; + use RoomTrait; + use AccommodationTrait; + use PlaceTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationCategory' => ['Text'], + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'bed' => ['BedDetails', 'Text', 'BedType'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'floorLevel' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'occupancy' => ['QuantitativeValue'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'permittedUsage' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'], + 'yearBuilt' => ['Number'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bed', - 'occupancy' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'bed' => ['BedDetails', 'BedType', 'Text'], - 'occupancy' => ['QuantitativeValue'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationCategory' => 'Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values).', + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'bed' => 'The type of bed or beds included in the accommodation. For the single case of just one bed of a certain type, you use bed directly with a text. If you want to indicate the quantity of a certain kind of bed, use an instance of BedDetails. For more detailed information, use the amenityFeature property.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'floorLevel' => 'The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'occupancy' => 'The allowed total occupancy for the accommodation in persons (including infants etc). For individual accommodations, this is not necessarily the legal maximum but defines the permitted usage as per the contractual agreement (e.g. a double room used by a single person). Typical unit code(s): C62 for person', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.', + 'yearBuilt' => 'The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). ' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bed' => 'The type of bed or beds included in the accommodation. For the single case of just one bed of a certain type, you use bed directly with a text. If you want to indicate the quantity of a certain kind of bed, use an instance of BedDetails. For more detailed information, use the amenityFeature property.', - 'occupancy' => 'The allowed total occupancy for the accommodation in persons (including infants etc). For individual accommodations, this is not necessarily the legal maximum but defines the permitted usage as per the contractual agreement (e.g. a double room used by a single person). Typical unit code(s): C62 for person' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The type of bed or beds included in the accommodation. For the single case - * of just one bed of a certain type, you use bed directly with a text. If you - * want to indicate the quantity of a certain kind of bed, use an instance of - * BedDetails. For more detailed information, use the amenityFeature property. - * - * @var mixed|BedDetails|BedType|string [schema.org types: BedDetails, BedType, Text] - */ - public $bed; - /** - * The allowed total occupancy for the accommodation in persons (including - * infants etc). For individual accommodations, this is not necessarily the - * legal maximum but defines the permitted usage as per the contractual - * agreement (e.g. a double room used by a single person). Typical unit - * code(s): C62 for person - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $occupancy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bed', 'occupancy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HotelRoomInterface.php b/src/models/jsonld/HotelRoomInterface.php new file mode 100644 index 000000000..e669a348a --- /dev/null +++ b/src/models/jsonld/HotelRoomInterface.php @@ -0,0 +1,24 @@ +http://en.wikipedia.org/wiki/House). * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/House + * @see https://schema.org/House */ -class House extends Accommodation +class House extends MetaJsonLd implements HouseInterface, AccommodationInterface, PlaceInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -33,162 +34,231 @@ class House extends Accommodation * * @var string */ - static public $schemaTypeName = 'House'; + static public string $schemaTypeName = 'House'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/House'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'A house is a building or structure that has the ability to be occupied for habitation by humans or other creatures (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/House).'; + static public string $schemaTypeScope = 'https://schema.org/House'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Accommodation'; + static public string $schemaTypeExtends = 'Accommodation'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<http://en.wikipedia.org/wiki/House). +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use HouseTrait; + use AccommodationTrait; + use PlaceTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationCategory' => ['Text'], + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'floorLevel' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'permittedUsage' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'], + 'yearBuilt' => ['Number'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'numberOfRooms' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationCategory' => 'Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values).', + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'floorLevel' => 'The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.', + 'yearBuilt' => 'The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). ' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'numberOfRooms' => ['Number', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] + * @inheritdoc */ - public $numberOfRooms; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['numberOfRooms'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HouseInterface.php b/src/models/jsonld/HouseInterface.php new file mode 100644 index 000000000..044865e3a --- /dev/null +++ b/src/models/jsonld/HouseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HousePainterInterface.php b/src/models/jsonld/HousePainterInterface.php new file mode 100644 index 000000000..f374bf6cd --- /dev/null +++ b/src/models/jsonld/HousePainterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/HowItWorksHealthAspectInterface.php b/src/models/jsonld/HowItWorksHealthAspectInterface.php new file mode 100644 index 000000000..d130a6c35 --- /dev/null +++ b/src/models/jsonld/HowItWorksHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HowOrWhereHealthAspectInterface.php b/src/models/jsonld/HowOrWhereHealthAspectInterface.php new file mode 100644 index 000000000..b48161070 --- /dev/null +++ b/src/models/jsonld/HowOrWhereHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'estimatedCost' => ['Text', 'MonetaryAmount'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'performTime' => ['Duration'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'prepTime' => ['Duration'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'step' => ['HowToStep', 'HowToSection', 'Text', 'CreativeWork'], + 'steps' => ['ItemList', 'CreativeWork', 'Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supply' => ['HowToSupply', 'Text'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'tool' => ['HowToTool', 'Text'], + 'totalTime' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'yield' => ['Text', 'QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'estimatedCost', - 'performTime', - 'prepTime', - 'step', - 'supply', - 'tool', - 'totalTime', - 'yield' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'estimatedCost' => ['MonetaryAmount', 'Text'], - 'performTime' => ['Duration'], - 'prepTime' => ['Duration'], - 'step' => ['CreativeWork', 'HowToSection', 'HowToStep', 'Text'], - 'supply' => ['HowToSupply', 'Text'], - 'tool' => ['HowToTool', 'Text'], - 'totalTime' => ['Duration'], - 'yield' => ['QuantitativeValue', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'estimatedCost' => 'The estimated cost of the supply or supplies consumed when performing instructions.', - 'performTime' => 'The length of time it takes to perform instructions or a direction (not including time to prepare the supplies), in ISO 8601 duration format.', - 'prepTime' => 'The length of time it takes to prepare the items to be used in instructions or a direction, in ISO 8601 duration format.', - 'step' => 'A single step item (as HowToStep, text, document, video, etc.) or a HowToSection. Supersedes steps.', - 'supply' => 'A sub-property of instrument. A supply consumed when performing instructions or a direction.', - 'tool' => 'A sub property of instrument. An object used (but not consumed) when performing instructions or a direction.', - 'totalTime' => 'The total time required to perform instructions or a direction (including time to prepare the supplies), in ISO 8601 duration format.', - 'yield' => 'The quantity that results by performing instructions. For example, a paper airplane, 10 personalized candles.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The estimated cost of the supply or supplies consumed when performing - * instructions. - * - * @var mixed|MonetaryAmount|string [schema.org types: MonetaryAmount, Text] - */ - public $estimatedCost; - /** - * The length of time it takes to perform instructions or a direction (not - * including time to prepare the supplies), in ISO 8601 duration format. - * - * @var Duration [schema.org types: Duration] - */ - public $performTime; - /** - * The length of time it takes to prepare the items to be used in instructions - * or a direction, in ISO 8601 duration format. - * - * @var Duration [schema.org types: Duration] + * @inheritdoc */ - public $prepTime; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'estimatedCost' => 'The estimated cost of the supply or supplies consumed when performing instructions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'performTime' => 'The length of time it takes to perform instructions or a direction (not including time to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'prepTime' => 'The length of time it takes to prepare the items to be used in instructions or a direction, in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'step' => 'A single step item (as HowToStep, text, document, video, etc.) or a HowToSection.', + 'steps' => 'A single step item (as HowToStep, text, document, video, etc.) or a HowToSection (originally misnamed \'steps\'; \'step\' is preferred).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supply' => 'A sub-property of instrument. A supply consumed when performing instructions or a direction.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'tool' => 'A sub property of instrument. An object used (but not consumed) when performing instructions or a direction.', + 'totalTime' => 'The total time required to perform instructions or a direction (including time to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'yield' => 'The quantity that results by performing instructions. For example, a paper airplane, 10 personalized candles.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A single step item (as HowToStep, text, document, video, etc.) or a - * HowToSection. Supersedes steps. - * - * @var mixed|CreativeWork|HowToSection|HowToStep|string [schema.org types: CreativeWork, HowToSection, HowToStep, Text] - */ - public $step; - /** - * A sub-property of instrument. A supply consumed when performing - * instructions or a direction. - * - * @var mixed|HowToSupply|string [schema.org types: HowToSupply, Text] - */ - public $supply; - /** - * A sub property of instrument. An object used (but not consumed) when - * performing instructions or a direction. - * - * @var mixed|HowToTool|string [schema.org types: HowToTool, Text] - */ - public $tool; /** - * The total time required to perform instructions or a direction (including - * time to prepare the supplies), in ISO 8601 duration format. - * - * @var Duration [schema.org types: Duration] - */ - public $totalTime; - /** - * The quantity that results by performing instructions. For example, a paper - * airplane, 10 personalized candles. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] + * @inheritdoc */ - public $yield; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['estimatedCost', 'performTime', 'prepTime', 'step', 'supply', 'tool', 'totalTime', 'yield'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HowToDirection.php b/src/models/jsonld/HowToDirection.php index 20920740d..77cf6eda5 100644 --- a/src/models/jsonld/HowToDirection.php +++ b/src/models/jsonld/HowToDirection.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'afterMedia' => ['URL', 'MediaObject'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'beforeMedia' => ['URL', 'MediaObject'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duringMedia' => ['URL', 'MediaObject'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'item' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'nextItem' => ['ListItem'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'performTime' => ['Duration'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'prepTime' => ['Duration'], + 'previousItem' => ['ListItem'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supply' => ['HowToSupply', 'Text'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'tool' => ['HowToTool', 'Text'], + 'totalTime' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'afterMedia', - 'beforeMedia', - 'duringMedia', - 'performTime', - 'prepTime', - 'supply', - 'tool', - 'totalTime' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'afterMedia' => ['MediaObject', 'URL'], - 'beforeMedia' => ['MediaObject', 'URL'], - 'duringMedia' => ['MediaObject', 'URL'], - 'performTime' => ['Duration'], - 'prepTime' => ['Duration'], - 'supply' => ['HowToSupply', 'Text'], - 'tool' => ['HowToTool', 'Text'], - 'totalTime' => ['Duration'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'afterMedia' => 'A media object representing the circumstances after performing this direction.', - 'beforeMedia' => 'A media object representing the circumstances before performing this direction.', - 'duringMedia' => 'A media object representing the circumstances while performing this direction.', - 'performTime' => 'The length of time it takes to perform instructions or a direction (not including time to prepare the supplies), in ISO 8601 duration format.', - 'prepTime' => 'The length of time it takes to prepare the items to be used in instructions or a direction, in ISO 8601 duration format.', - 'supply' => 'A sub-property of instrument. A supply consumed when performing instructions or a direction.', - 'tool' => 'A sub property of instrument. An object used (but not consumed) when performing instructions or a direction.', - 'totalTime' => 'The total time required to perform instructions or a direction (including time to prepare the supplies), in ISO 8601 duration format.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A media object representing the circumstances after performing this - * direction. - * - * @var mixed|MediaObject|string [schema.org types: MediaObject, URL] - */ - public $afterMedia; - /** - * A media object representing the circumstances before performing this - * direction. - * - * @var mixed|MediaObject|string [schema.org types: MediaObject, URL] - */ - public $beforeMedia; - /** - * A media object representing the circumstances while performing this - * direction. - * - * @var mixed|MediaObject|string [schema.org types: MediaObject, URL] + * @inheritdoc */ - public $duringMedia; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'afterMedia' => 'A media object representing the circumstances after performing this direction.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'beforeMedia' => 'A media object representing the circumstances before performing this direction.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duringMedia' => 'A media object representing the circumstances while performing this direction.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'nextItem' => 'A link to the ListItem that follows the current one.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'performTime' => 'The length of time it takes to perform instructions or a direction (not including time to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'prepTime' => 'The length of time it takes to prepare the items to be used in instructions or a direction, in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'previousItem' => 'A link to the ListItem that preceeds the current one.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supply' => 'A sub-property of instrument. A supply consumed when performing instructions or a direction.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'tool' => 'A sub property of instrument. An object used (but not consumed) when performing instructions or a direction.', + 'totalTime' => 'The total time required to perform instructions or a direction (including time to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The length of time it takes to perform instructions or a direction (not - * including time to prepare the supplies), in ISO 8601 duration format. - * - * @var Duration [schema.org types: Duration] - */ - public $performTime; - /** - * The length of time it takes to prepare the items to be used in instructions - * or a direction, in ISO 8601 duration format. - * - * @var Duration [schema.org types: Duration] - */ - public $prepTime; - /** - * A sub-property of instrument. A supply consumed when performing - * instructions or a direction. - * - * @var mixed|HowToSupply|string [schema.org types: HowToSupply, Text] - */ - public $supply; /** - * A sub property of instrument. An object used (but not consumed) when - * performing instructions or a direction. - * - * @var mixed|HowToTool|string [schema.org types: HowToTool, Text] - */ - public $tool; - /** - * The total time required to perform instructions or a direction (including - * time to prepare the supplies), in ISO 8601 duration format. - * - * @var Duration [schema.org types: Duration] + * @inheritdoc */ - public $totalTime; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['afterMedia', 'beforeMedia', 'duringMedia', 'performTime', 'prepTime', 'supply', 'tool', 'totalTime'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HowToDirectionInterface.php b/src/models/jsonld/HowToDirectionInterface.php new file mode 100644 index 000000000..a94697a5f --- /dev/null +++ b/src/models/jsonld/HowToDirectionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'item' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nextItem' => ['ListItem'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'previousItem' => ['ListItem'], + 'requiredQuantity' => ['QuantitativeValue', 'Number', 'Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'requiredQuantity' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', + '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.', + 'name' => 'The name of the item.', + 'nextItem' => 'A link to the ListItem that follows the current one.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'previousItem' => 'A link to the ListItem that preceeds the current one.', + 'requiredQuantity' => 'The required quantity of the item(s).', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'requiredQuantity' => ['Number', 'QuantitativeValue', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'requiredQuantity' => 'The required quantity of the item(s).' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The required quantity of the item(s). - * - * @var mixed|float|QuantitativeValue|string [schema.org types: Number, QuantitativeValue, Text] + * @inheritdoc */ - public $requiredQuantity; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['requiredQuantity'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HowToItemInterface.php b/src/models/jsonld/HowToItemInterface.php new file mode 100644 index 000000000..77dd1abad --- /dev/null +++ b/src/models/jsonld/HowToItemInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'item' => ['Thing'], + 'itemListElement' => ['Thing', 'ListItem', 'Text'], + 'itemListOrder' => ['Text', 'ItemListOrderType'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'nextItem' => ['ListItem'], + 'numberOfItems' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'previousItem' => ['ListItem'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'steps' => ['ItemList', 'CreativeWork', 'Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', + 'itemListElement' => 'For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem. Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists. Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a \'position\' property in such cases.', + 'itemListOrder' => 'Type of ordering (e.g. Ascending, Descending, Unordered).', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'nextItem' => 'A link to the ListItem that follows the current one.', + 'numberOfItems' => 'The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'previousItem' => 'A link to the ListItem that preceeds the current one.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'steps' => 'A single step item (as HowToStep, text, document, video, etc.) or a HowToSection (originally misnamed \'steps\'; \'step\' is preferred).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HowToSectionInterface.php b/src/models/jsonld/HowToSectionInterface.php new file mode 100644 index 000000000..9ac68b87c --- /dev/null +++ b/src/models/jsonld/HowToSectionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'item' => ['Thing'], + 'itemListElement' => ['Thing', 'ListItem', 'Text'], + 'itemListOrder' => ['Text', 'ItemListOrderType'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'nextItem' => ['ListItem'], + 'numberOfItems' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'previousItem' => ['ListItem'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', + 'itemListElement' => 'For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem. Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists. Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a \'position\' property in such cases.', + 'itemListOrder' => 'Type of ordering (e.g. Ascending, Descending, Unordered).', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'nextItem' => 'A link to the ListItem that follows the current one.', + 'numberOfItems' => 'The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'previousItem' => 'A link to the ListItem that preceeds the current one.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HowToStepInterface.php b/src/models/jsonld/HowToStepInterface.php new file mode 100644 index 000000000..8d320faed --- /dev/null +++ b/src/models/jsonld/HowToStepInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'estimatedCost' => ['Text', 'MonetaryAmount'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'item' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nextItem' => ['ListItem'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'previousItem' => ['ListItem'], + 'requiredQuantity' => ['QuantitativeValue', 'Number', 'Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'estimatedCost' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'estimatedCost' => 'The estimated cost of the supply or supplies consumed when performing instructions.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', + '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.', + 'name' => 'The name of the item.', + 'nextItem' => 'A link to the ListItem that follows the current one.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'previousItem' => 'A link to the ListItem that preceeds the current one.', + 'requiredQuantity' => 'The required quantity of the item(s).', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'estimatedCost' => ['MonetaryAmount', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'estimatedCost' => 'The estimated cost of the supply or supplies consumed when performing instructions.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The estimated cost of the supply or supplies consumed when performing - * instructions. - * - * @var mixed|MonetaryAmount|string [schema.org types: MonetaryAmount, Text] + * @inheritdoc */ - public $estimatedCost; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['estimatedCost'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HowToSupplyInterface.php b/src/models/jsonld/HowToSupplyInterface.php new file mode 100644 index 000000000..82054cdfd --- /dev/null +++ b/src/models/jsonld/HowToSupplyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'item' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'nextItem' => ['ListItem'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'previousItem' => ['ListItem'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'nextItem' => 'A link to the ListItem that follows the current one.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'previousItem' => 'A link to the ListItem that preceeds the current one.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HowToTipInterface.php b/src/models/jsonld/HowToTipInterface.php new file mode 100644 index 000000000..2b721f12d --- /dev/null +++ b/src/models/jsonld/HowToTipInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'item' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nextItem' => ['ListItem'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'previousItem' => ['ListItem'], + 'requiredQuantity' => ['QuantitativeValue', 'Number', 'Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'requiredQuantity' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', + '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.', + 'name' => 'The name of the item.', + 'nextItem' => 'A link to the ListItem that follows the current one.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'previousItem' => 'A link to the ListItem that preceeds the current one.', + 'requiredQuantity' => 'The required quantity of the item(s).', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'requiredQuantity' => ['Number', 'QuantitativeValue', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'requiredQuantity' => 'The required quantity of the item(s).' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The required quantity of the item(s). - * - * @var mixed|float|QuantitativeValue|string [schema.org types: Number, QuantitativeValue, Text] + * @inheritdoc */ - public $requiredQuantity; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['requiredQuantity'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/HowToToolInterface.php b/src/models/jsonld/HowToToolInterface.php new file mode 100644 index 000000000..920e3ef74 --- /dev/null +++ b/src/models/jsonld/HowToToolInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'tocEntry' => ['HyperTocEntry'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'tocEntry' => 'Indicates a [[HyperTocEntry]] in a [[HyperToc]].', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/HyperTocEntry.php b/src/models/jsonld/HyperTocEntry.php new file mode 100644 index 000000000..f8eecef18 --- /dev/null +++ b/src/models/jsonld/HyperTocEntry.php @@ -0,0 +1,382 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'tocContinuation' => ['HyperTocEntry'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'utterances' => ['Text'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'tocContinuation' => 'A [[HyperTocEntry]] can have a [[tocContinuation]] indicated, which is another [[HyperTocEntry]] that would be the default next item to play or render.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'utterances' => 'Text of an utterances (spoken words, lyrics etc.) that occurs at a certain section of a media object, represented as a [[HyperTocEntry]].', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/HyperTocEntryInterface.php b/src/models/jsonld/HyperTocEntryInterface.php new file mode 100644 index 000000000..225b37311 --- /dev/null +++ b/src/models/jsonld/HyperTocEntryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/IOSPlatformInterface.php b/src/models/jsonld/IOSPlatformInterface.php new file mode 100644 index 000000000..8fe8992b0 --- /dev/null +++ b/src/models/jsonld/IOSPlatformInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/IceCreamShopInterface.php b/src/models/jsonld/IceCreamShopInterface.php new file mode 100644 index 000000000..ca0799942 --- /dev/null +++ b/src/models/jsonld/IceCreamShopInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/IgnoreActionInterface.php b/src/models/jsonld/IgnoreActionInterface.php new file mode 100644 index 000000000..861e9b7ea --- /dev/null +++ b/src/models/jsonld/IgnoreActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ImageGalleryInterface.php b/src/models/jsonld/ImageGalleryInterface.php new file mode 100644 index 000000000..e31f32787 --- /dev/null +++ b/src/models/jsonld/ImageGalleryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'caption' => ['Text', 'MediaObject'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'embeddedTextCaption' => ['Text'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'exifData' => ['PropertyValue', 'Text'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'representativeOfPage' => ['Boolean'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnail' => ['ImageObject'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'caption', - 'exifData', - 'representativeOfPage', - 'thumbnail' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'caption' => ['MediaObject', 'Text'], - 'exifData' => ['PropertyValue', 'Text'], - 'representativeOfPage' => ['Boolean'], - 'thumbnail' => ['ImageObject'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the encodingFormat.', - 'exifData' => 'exif data for this object.', - 'representativeOfPage' => 'Indicates whether this image is representative of the content of the page.', - 'thumbnail' => 'Thumbnail image for an image or video.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]].', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'embeddedTextCaption' => 'Represents textual captioning from a [[MediaObject]], e.g. text of a \'meme\'.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'exifData' => 'exif data for this object.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'representativeOfPage' => 'Indicates whether this image is representative of the content of the page.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnail' => 'Thumbnail image for an image or video.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The caption for this object. For downloadable machine formats (closed - * caption, subtitles etc.) use MediaObject and indicate the encodingFormat. - * - * @var mixed|MediaObject|string [schema.org types: MediaObject, Text] - */ - public $caption; - /** - * exif data for this object. - * - * @var mixed|PropertyValue|string [schema.org types: PropertyValue, Text] - */ - public $exifData; - /** - * Indicates whether this image is representative of the content of the page. - * - * @var bool [schema.org types: Boolean] - */ - public $representativeOfPage; /** - * Thumbnail image for an image or video. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $thumbnail; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['caption', 'exifData', 'representativeOfPage', 'thumbnail'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ImageObjectInterface.php b/src/models/jsonld/ImageObjectInterface.php new file mode 100644 index 000000000..5f74770d4 --- /dev/null +++ b/src/models/jsonld/ImageObjectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'caption' => ['Text', 'MediaObject'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'embeddedTextCaption' => ['Text'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'exifData' => ['PropertyValue', 'Text'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'representativeOfPage' => ['Boolean'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnail' => ['ImageObject'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]].', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'embeddedTextCaption' => 'Represents textual captioning from a [[MediaObject]], e.g. text of a \'meme\'.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'exifData' => 'exif data for this object.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'representativeOfPage' => 'Indicates whether this image is representative of the content of the page.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnail' => 'Thumbnail image for an image or video.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ImageObjectSnapshotInterface.php b/src/models/jsonld/ImageObjectSnapshotInterface.php new file mode 100644 index 000000000..2b649a9ac --- /dev/null +++ b/src/models/jsonld/ImageObjectSnapshotInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'affectedBy' => ['Drug'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'imagingTechnique' => ['MedicalImagingTechnique'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'normalRange' => ['Text', 'MedicalEnumeration'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'signDetected' => ['MedicalSign'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'usedToDiagnose' => ['MedicalCondition'], + 'usesDevice' => ['MedicalDevice'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'imagingTechnique' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'affectedBy' => 'Drugs that affect the test\'s results.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'imagingTechnique' => 'Imaging technique used.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'normalRange' => 'Range of acceptable values for a typical patient, when applicable.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'signDetected' => 'A sign detected by the test.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'usedToDiagnose' => 'A condition the test is used to diagnose.', + 'usesDevice' => 'Device used to perform the test.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'imagingTechnique' => ['MedicalImagingTechnique'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'imagingTechnique' => 'Imaging technique used.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Imaging technique used. - * - * @var MedicalImagingTechnique [schema.org types: MedicalImagingTechnique] + * @inheritdoc */ - public $imagingTechnique; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['imagingTechnique'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ImagingTestInterface.php b/src/models/jsonld/ImagingTestInterface.php new file mode 100644 index 000000000..bb61c105a --- /dev/null +++ b/src/models/jsonld/ImagingTestInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InForceInterface.php b/src/models/jsonld/InForceInterface.php new file mode 100644 index 000000000..e3e1e18cc --- /dev/null +++ b/src/models/jsonld/InForceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InStockInterface.php b/src/models/jsonld/InStockInterface.php new file mode 100644 index 000000000..d58143b98 --- /dev/null +++ b/src/models/jsonld/InStockInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InStoreOnlyInterface.php b/src/models/jsonld/InStoreOnlyInterface.php new file mode 100644 index 000000000..09bc8ec4e --- /dev/null +++ b/src/models/jsonld/InStoreOnlyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'model' => ['ProductModel', 'Text'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'potentialAction' => ['Action'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'serialNumber' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'weight' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'serialNumber' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'weight' => 'The weight of the product or person.', + 'width' => 'The width of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'serialNumber' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The serial number or any alphanumeric identifier of a particular product. - * When attached to an offer, it is a shortcut for the serial number of the - * product included in the offer. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $serialNumber; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['serialNumber'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/IndividualProductInterface.php b/src/models/jsonld/IndividualProductInterface.php new file mode 100644 index 000000000..bb39a8135 --- /dev/null +++ b/src/models/jsonld/IndividualProductInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InfectiousAgentClass.php b/src/models/jsonld/InfectiousAgentClass.php index daf9506b7..93b5ece14 100644 --- a/src/models/jsonld/InfectiousAgentClass.php +++ b/src/models/jsonld/InfectiousAgentClass.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InfectiousAgentClassInterface.php b/src/models/jsonld/InfectiousAgentClassInterface.php new file mode 100644 index 000000000..b1488c990 --- /dev/null +++ b/src/models/jsonld/InfectiousAgentClassInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'differentialDiagnosis' => ['DDxElement'], + 'disambiguatingDescription' => ['Text'], + 'drug' => ['Drug'], + 'epidemiology' => ['Text'], + 'expectedPrognosis' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'infectiousAgent' => ['Text'], + 'infectiousAgentClass' => ['InfectiousAgentClass'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'naturalProgression' => ['Text'], + 'pathophysiology' => ['Text'], + 'possibleComplication' => ['Text'], + 'possibleTreatment' => ['MedicalTherapy'], + 'potentialAction' => ['Action'], + 'primaryPrevention' => ['MedicalTherapy'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'riskFactor' => ['MedicalRiskFactor'], + 'sameAs' => ['URL'], + 'secondaryPrevention' => ['MedicalTherapy'], + 'signOrSymptom' => ['MedicalSignOrSymptom'], + 'stage' => ['MedicalConditionStage'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'transmissionMethod' => ['Text'], + 'typicalTest' => ['MedicalTest'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'infectiousAgent', - 'infectiousAgentClass', - 'transmissionMethod' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'infectiousAgent' => ['Text'], - 'infectiousAgentClass' => ['InfectiousAgentClass'], - 'transmissionMethod' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'infectiousAgent' => 'The actual infectious agent, such as a specific bacterium.', - 'infectiousAgentClass' => 'The class of infectious agent (bacteria, prion, etc.) that causes the disease.', - 'transmissionMethod' => 'How the disease spreads, either as a route or vector, for example \'direct contact\', \'Aedes aegypti\', etc.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + 'differentialDiagnosis' => 'One of a set of differential diagnoses for the condition. Specifically, a closely-related or competing diagnosis typically considered later in the cognitive process whereby this medical condition is distinguished from others most likely responsible for a similar collection of signs and symptoms to reach the most parsimonious diagnosis or diagnoses in a patient.', + '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.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', + 'expectedPrognosis' => 'The likely outcome in either the short term or long term of the medical condition.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'infectiousAgent' => 'The actual infectious agent, such as a specific bacterium.', + 'infectiousAgentClass' => 'The class of infectious agent (bacteria, prion, etc.) that causes the disease.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'naturalProgression' => 'The expected progression of the condition if it is not treated and allowed to progress naturally.', + 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.', + 'possibleComplication' => 'A possible unexpected and unfavorable evolution of a medical condition. Complications may include worsening of the signs or symptoms of the disease, extension of the condition to other organ systems, etc.', + 'possibleTreatment' => 'A possible treatment to address this condition, sign or symptom.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryPrevention' => 'A preventative therapy used to prevent an initial occurrence of the medical condition, such as vaccination.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'riskFactor' => 'A modifiable or non-modifiable factor that increases the risk of a patient contracting this condition, e.g. age, coexisting condition.', + '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.', + 'secondaryPrevention' => 'A preventative therapy used to prevent reoccurrence of the medical condition after an initial episode of the condition.', + 'signOrSymptom' => 'A sign or symptom of this condition. Signs are objective or physically observable manifestations of the medical condition while symptoms are the subjective experience of the medical condition.', + 'stage' => 'The stage of the condition, if applicable.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'transmissionMethod' => 'How the disease spreads, either as a route or vector, for example \'direct contact\', \'Aedes aegypti\', etc.', + 'typicalTest' => 'A medical test typically performed given this condition.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The actual infectious agent, such as a specific bacterium. - * - * @var string [schema.org types: Text] - */ - public $infectiousAgent; - /** - * The class of infectious agent (bacteria, prion, etc.) that causes the - * disease. - * - * @var InfectiousAgentClass [schema.org types: InfectiousAgentClass] - */ - public $infectiousAgentClass; /** - * How the disease spreads, either as a route or vector, for example 'direct - * contact', 'Aedes aegypti', etc. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $transmissionMethod; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['infectiousAgent', 'infectiousAgentClass', 'transmissionMethod'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InfectiousDiseaseInterface.php b/src/models/jsonld/InfectiousDiseaseInterface.php new file mode 100644 index 000000000..63a11c751 --- /dev/null +++ b/src/models/jsonld/InfectiousDiseaseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'event' => ['Event'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'event' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'event' => ['Event'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $event; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['event'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InformActionInterface.php b/src/models/jsonld/InformActionInterface.php new file mode 100644 index 000000000..0db95a5fe --- /dev/null +++ b/src/models/jsonld/InformActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/IngredientsHealthAspectInterface.php b/src/models/jsonld/IngredientsHealthAspectInterface.php new file mode 100644 index 000000000..d8b906a0e --- /dev/null +++ b/src/models/jsonld/IngredientsHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'collection' => ['Thing'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'targetCollection' => ['Thing'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'toLocation' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'collection' => 'A sub property of object. The collection target of the action.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'targetCollection' => 'A sub property of object. The collection target of the action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'toLocation' => ['Place'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InsertActionInterface.php b/src/models/jsonld/InsertActionInterface.php new file mode 100644 index 000000000..803e19f14 --- /dev/null +++ b/src/models/jsonld/InsertActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InstallActionInterface.php b/src/models/jsonld/InstallActionInterface.php new file mode 100644 index 000000000..6ad5da1aa --- /dev/null +++ b/src/models/jsonld/InstallActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/InstallmentInterface.php b/src/models/jsonld/InstallmentInterface.php new file mode 100644 index 000000000..c396cd4b3 --- /dev/null +++ b/src/models/jsonld/InstallmentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'feesAndCommissionsSpecification' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'feesAndCommissionsSpecification' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Description of fees, commissions, and other terms applied either to a class - * of financial product, or by a financial service organization. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $feesAndCommissionsSpecification; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['feesAndCommissionsSpecification'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InsuranceAgencyInterface.php b/src/models/jsonld/InsuranceAgencyInterface.php new file mode 100644 index 000000000..8d5807ccd --- /dev/null +++ b/src/models/jsonld/InsuranceAgencyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/IntangibleInterface.php b/src/models/jsonld/IntangibleInterface.php new file mode 100644 index 000000000..6eb386664 --- /dev/null +++ b/src/models/jsonld/IntangibleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/IntegerInterface.php b/src/models/jsonld/IntegerInterface.php new file mode 100644 index 000000000..926828ee6 --- /dev/null +++ b/src/models/jsonld/IntegerInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InteractActionInterface.php b/src/models/jsonld/InteractActionInterface.php new file mode 100644 index 000000000..f65022429 --- /dev/null +++ b/src/models/jsonld/InteractActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionService' => ['SoftwareApplication', 'WebSite'], + 'interactionType' => ['Action'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'userInteractionCount' => ['Integer'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'interactionService', - 'interactionType', - 'userInteractionCount' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'interactionService' => ['SoftwareApplication', 'WebSite'], - 'interactionType' => ['Action'], - 'userInteractionCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'interactionService' => 'The WebSite or SoftwareApplication where the interactions took place.', - 'interactionType' => 'The Action representing the type of interaction. For up votes, +1s, etc. use LikeAction. For down votes use DislikeAction. Otherwise, use the most specific Action.', - 'userInteractionCount' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionService' => 'The WebSite or SoftwareApplication where the interactions took place.', + 'interactionType' => 'The Action representing the type of interaction. For up votes, +1s, etc. use [[LikeAction]]. For down votes use [[DislikeAction]]. Otherwise, use the most specific Action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'userInteractionCount' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The WebSite or SoftwareApplication where the interactions took place. - * - * @var mixed|SoftwareApplication|WebSite [schema.org types: SoftwareApplication, WebSite] - */ - public $interactionService; - /** - * The Action representing the type of interaction. For up votes, +1s, etc. - * use LikeAction. For down votes use DislikeAction. Otherwise, use the most - * specific Action. - * - * @var Action [schema.org types: Action] - */ - public $interactionType; /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $userInteractionCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['interactionService', 'interactionType', 'userInteractionCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InteractionCounterInterface.php b/src/models/jsonld/InteractionCounterInterface.php new file mode 100644 index 000000000..66769484d --- /dev/null +++ b/src/models/jsonld/InteractionCounterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InternationalTrialInterface.php b/src/models/jsonld/InternationalTrialInterface.php new file mode 100644 index 000000000..deaa51665 --- /dev/null +++ b/src/models/jsonld/InternationalTrialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InternetCafeInterface.php b/src/models/jsonld/InternetCafeInterface.php new file mode 100644 index 000000000..5d13b791d --- /dev/null +++ b/src/models/jsonld/InternetCafeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'amount' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amount' => ['MonetaryAmount', 'Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amount' => 'The amount of money.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The amount of money. - * - * @var mixed|MonetaryAmount|float [schema.org types: MonetaryAmount, Number] + * @inheritdoc */ - public $amount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InvestmentFundInterface.php b/src/models/jsonld/InvestmentFundInterface.php new file mode 100644 index 000000000..a9b73a47e --- /dev/null +++ b/src/models/jsonld/InvestmentFundInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'amount' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amount' => ['MonetaryAmount', 'Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amount' => 'The amount of money.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The amount of money. - * - * @var mixed|MonetaryAmount|float [schema.org types: MonetaryAmount, Number] + * @inheritdoc */ - public $amount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InvestmentOrDepositInterface.php b/src/models/jsonld/InvestmentOrDepositInterface.php new file mode 100644 index 000000000..01350d5c4 --- /dev/null +++ b/src/models/jsonld/InvestmentOrDepositInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'event' => ['Event'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'event' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'event' => ['Event'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $event; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['event'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InviteActionInterface.php b/src/models/jsonld/InviteActionInterface.php new file mode 100644 index 000000000..be08b663a --- /dev/null +++ b/src/models/jsonld/InviteActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accountId' => ['Text'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'billingPeriod' => ['Duration'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'confirmationNumber' => ['Text'], + 'customer' => ['Organization', 'Person'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'minimumPaymentDue' => ['MonetaryAmount', 'PriceSpecification'], + 'name' => ['Text'], + 'paymentDue' => ['DateTime'], + 'paymentDueDate' => ['DateTime', 'Date'], + 'paymentMethod' => ['PaymentMethod'], + 'paymentMethodId' => ['Text'], + 'paymentStatus' => ['PaymentStatusType', 'Text'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'referencesOrder' => ['Order'], + 'sameAs' => ['URL'], + 'scheduledPaymentDate' => ['Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPaymentDue' => ['MonetaryAmount', 'PriceSpecification'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accountId', - 'billingPeriod', - 'broker', - 'category', - 'confirmationNumber', - 'customer', - 'minimumPaymentDue', - 'paymentDueDate', - 'paymentMethod', - 'paymentMethodId', - 'paymentStatus', - 'provider', - 'referencesOrder', - 'scheduledPaymentDate', - 'totalPaymentDue' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accountId' => ['Text'], - 'billingPeriod' => ['Duration'], - 'broker' => ['Organization', 'Person'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'confirmationNumber' => ['Text'], - 'customer' => ['Organization', 'Person'], - 'minimumPaymentDue' => ['MonetaryAmount', 'PriceSpecification'], - 'paymentDueDate' => ['Date', 'DateTime'], - 'paymentMethod' => ['PaymentMethod'], - 'paymentMethodId' => ['Text'], - 'paymentStatus' => ['PaymentStatusType', 'Text'], - 'provider' => ['Organization', 'Person'], - 'referencesOrder' => ['Order'], - 'scheduledPaymentDate' => ['Date'], - 'totalPaymentDue' => ['MonetaryAmount', 'PriceSpecification'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accountId' => 'The identifier for the account the payment will be applied to.', - 'billingPeriod' => 'The time interval used to compute the invoice.', - '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. Supersedes bookingAgent.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'confirmationNumber' => 'A number that confirms the given order or payment has been received.', - 'customer' => 'Party placing the order or paying the invoice.', - 'minimumPaymentDue' => 'The minimum payment required at this time.', - 'paymentDueDate' => 'The date that payment is due. Supersedes paymentDue.', - 'paymentMethod' => 'The name of the credit card or other method of payment for the order.', - 'paymentMethodId' => 'An identifier for the method of payment used (e.g. the last 4 digits of the credit card).', - 'paymentStatus' => 'The status of payment; whether the invoice has been paid or not.', - '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. Supersedes carrier.', - 'referencesOrder' => 'The Order(s) related to this Invoice. One or more Orders may be combined into a single Invoice.', - 'scheduledPaymentDate' => 'The date the invoice is scheduled to be paid.', - 'totalPaymentDue' => 'The total amount due.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The identifier for the account the payment will be applied to. - * - * @var string [schema.org types: Text] - */ - public $accountId; - /** - * The time interval used to compute the invoice. - * - * @var Duration [schema.org types: Duration] - */ - public $billingPeriod; - /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * A number that confirms the given order or payment has been received. - * - * @var string [schema.org types: Text] - */ - public $confirmationNumber; - /** - * Party placing the order or paying the invoice. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $customer; - /** - * The minimum payment required at this time. - * - * @var mixed|MonetaryAmount|PriceSpecification [schema.org types: MonetaryAmount, PriceSpecification] - */ - public $minimumPaymentDue; - /** - * The date that payment is due. Supersedes paymentDue. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $paymentDueDate; - /** - * The name of the credit card or other method of payment for the order. - * - * @var PaymentMethod [schema.org types: PaymentMethod] - */ - public $paymentMethod; - /** - * An identifier for the method of payment used (e.g. the last 4 digits of the - * credit card). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $paymentMethodId; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accountId' => 'The identifier for the account the payment will be applied to.', + '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.', + 'alternateName' => 'An alias for the item.', + 'billingPeriod' => 'The time interval used to compute the invoice.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'confirmationNumber' => 'A number that confirms the given order or payment has been received.', + 'customer' => 'Party placing the order or paying the invoice.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'minimumPaymentDue' => 'The minimum payment required at this time.', + 'name' => 'The name of the item.', + 'paymentDue' => 'The date that payment is due.', + 'paymentDueDate' => 'The date that payment is due.', + 'paymentMethod' => 'The name of the credit card or other method of payment for the order.', + 'paymentMethodId' => 'An identifier for the method of payment used (e.g. the last 4 digits of the credit card).', + 'paymentStatus' => 'The status of payment; whether the invoice has been paid or not.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'referencesOrder' => 'The Order(s) related to this Invoice. One or more Orders may be combined into a single Invoice.', + '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.', + 'scheduledPaymentDate' => 'The date the invoice is scheduled to be paid.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'totalPaymentDue' => 'The total amount due.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The status of payment; whether the invoice has been paid or not. - * - * @var mixed|PaymentStatusType|string [schema.org types: PaymentStatusType, Text] - */ - public $paymentStatus; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * The Order(s) related to this Invoice. One or more Orders may be combined - * into a single Invoice. - * - * @var Order [schema.org types: Order] - */ - public $referencesOrder; /** - * The date the invoice is scheduled to be paid. - * - * @var Date [schema.org types: Date] - */ - public $scheduledPaymentDate; - /** - * The total amount due. - * - * @var mixed|MonetaryAmount|PriceSpecification [schema.org types: MonetaryAmount, PriceSpecification] + * @inheritdoc */ - public $totalPaymentDue; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accountId', 'billingPeriod', 'broker', 'category', 'confirmationNumber', 'customer', 'minimumPaymentDue', 'paymentDueDate', 'paymentMethod', 'paymentMethodId', 'paymentStatus', 'provider', 'referencesOrder', 'scheduledPaymentDate', 'totalPaymentDue'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/InvoiceInterface.php b/src/models/jsonld/InvoiceInterface.php new file mode 100644 index 000000000..e0c288ec4 --- /dev/null +++ b/src/models/jsonld/InvoiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/InvoicePriceInterface.php b/src/models/jsonld/InvoicePriceInterface.php new file mode 100644 index 000000000..93a272f7a --- /dev/null +++ b/src/models/jsonld/InvoicePriceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ItemAvailabilityInterface.php b/src/models/jsonld/ItemAvailabilityInterface.php new file mode 100644 index 000000000..bef042155 --- /dev/null +++ b/src/models/jsonld/ItemAvailabilityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itemListElement' => ['Thing', 'ListItem', 'Text'], + 'itemListOrder' => ['Text', 'ItemListOrderType'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'numberOfItems' => ['Integer'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemListElement', - 'itemListOrder', - 'numberOfItems' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemListElement' => ['ListItem', 'Text', 'Thing'], - 'itemListOrder' => ['ItemListOrderType', 'Text'], - 'numberOfItems' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'itemListElement' => 'For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem. Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists. Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a \'position\' property in such cases.', - 'itemListOrder' => 'Type of ordering (e.g. Ascending, Descending, Unordered).', - 'numberOfItems' => 'The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itemListElement' => 'For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem. Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists. Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a \'position\' property in such cases.', + 'itemListOrder' => 'Type of ordering (e.g. Ascending, Descending, Unordered).', + '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.', + 'name' => 'The name of the item.', + 'numberOfItems' => 'The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For itemListElement values, you can use simple strings (e.g. "Peter", - * "Paul", "Mary"), existing entities, or use ListItem. Text values are best - * if the elements in the list are plain strings. Existing entities are best - * for a simple, unordered list of existing things in your data. ListItem is - * used with ordered lists when you want to provide additional context about - * the element in that list or when the same item might be in different places - * in different lists. Note: The order of elements in your mark-up is not - * sufficient for indicating the order or elements. Use ListItem with a - * 'position' property in such cases. - * - * @var mixed|ListItem|string|Thing [schema.org types: ListItem, Text, Thing] - */ - public $itemListElement; - /** - * Type of ordering (e.g. Ascending, Descending, Unordered). - * - * @var mixed|ItemListOrderType|string [schema.org types: ItemListOrderType, Text] - */ - public $itemListOrder; /** - * The number of items in an ItemList. Note that some descriptions might not - * fully describe all items in a list (e.g., multi-page pagination); in such - * cases, the numberOfItems would be for the entire list. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $numberOfItems; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemListElement', 'itemListOrder', 'numberOfItems'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ItemListInterface.php b/src/models/jsonld/ItemListInterface.php new file mode 100644 index 000000000..e196b844f --- /dev/null +++ b/src/models/jsonld/ItemListInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ItemListOrderAscendingInterface.php b/src/models/jsonld/ItemListOrderAscendingInterface.php new file mode 100644 index 000000000..f5dbb2368 --- /dev/null +++ b/src/models/jsonld/ItemListOrderAscendingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ItemListOrderDescendingInterface.php b/src/models/jsonld/ItemListOrderDescendingInterface.php new file mode 100644 index 000000000..a75a2aa7c --- /dev/null +++ b/src/models/jsonld/ItemListOrderDescendingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ItemListOrderTypeInterface.php b/src/models/jsonld/ItemListOrderTypeInterface.php new file mode 100644 index 000000000..693bea7d7 --- /dev/null +++ b/src/models/jsonld/ItemListOrderTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ItemListUnorderedInterface.php b/src/models/jsonld/ItemListUnorderedInterface.php new file mode 100644 index 000000000..550f786d5 --- /dev/null +++ b/src/models/jsonld/ItemListUnorderedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ItemPageInterface.php b/src/models/jsonld/ItemPageInterface.php new file mode 100644 index 000000000..a90bde370 --- /dev/null +++ b/src/models/jsonld/ItemPageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/JewelryStoreInterface.php b/src/models/jsonld/JewelryStoreInterface.php new file mode 100644 index 000000000..19339b691 --- /dev/null +++ b/src/models/jsonld/JewelryStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'applicantLocationRequirements' => ['AdministrativeArea'], + 'applicationContact' => ['ContactPoint'], + 'baseSalary' => ['Number', 'PriceSpecification', 'MonetaryAmount'], + 'benefits' => ['Text'], + 'datePosted' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'directApply' => ['Boolean'], + 'disambiguatingDescription' => ['Text'], + 'educationRequirements' => ['EducationalOccupationalCredential', 'Text'], + 'eligibilityToWorkRequirement' => ['Text'], + 'employerOverview' => ['Text'], + 'employmentType' => ['Text'], + 'employmentUnit' => ['Organization'], + 'estimatedSalary' => ['MonetaryAmountDistribution', 'MonetaryAmount', 'Number'], + 'experienceInPlaceOfEducation' => ['Boolean'], + 'experienceRequirements' => ['Text', 'OccupationalExperienceRequirements'], + 'hiringOrganization' => ['Organization'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'incentiveCompensation' => ['Text'], + 'incentives' => ['Text'], + 'industry' => ['DefinedTerm', 'Text'], + 'jobBenefits' => ['Text'], + 'jobImmediateStart' => ['Boolean'], + 'jobLocation' => ['Place'], + 'jobLocationType' => ['Text'], + 'jobStartDate' => ['Date', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'occupationalCategory' => ['CategoryCode', 'Text'], + 'physicalRequirement' => ['URL', 'Text', 'DefinedTerm'], + 'potentialAction' => ['Action'], + 'qualifications' => ['Text', 'EducationalOccupationalCredential'], + 'relevantOccupation' => ['Occupation'], + 'responsibilities' => ['Text'], + 'salaryCurrency' => ['Text'], + 'sameAs' => ['URL'], + 'securityClearanceRequirement' => ['URL', 'Text'], + 'sensoryRequirement' => ['DefinedTerm', 'URL', 'Text'], + 'skills' => ['Text', 'DefinedTerm'], + 'specialCommitments' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'title' => ['Text'], + 'totalJobOpenings' => ['Integer'], + 'url' => ['URL'], + 'validThrough' => ['DateTime', 'Date'], + 'workHours' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'applicantLocationRequirements', - 'applicationContact', - 'baseSalary', - 'datePosted', - 'educationRequirements', - 'employerOverview', - 'employmentType', - 'employmentUnit', - 'estimatedSalary', - 'experienceRequirements', - 'hiringOrganization', - 'incentiveCompensation', - 'industry', - 'jobBenefits', - 'jobImmediateStart', - 'jobLocation', - 'jobLocationType', - 'jobStartDate', - 'occupationalCategory', - 'physicalRequirement', - 'qualifications', - 'relevantOccupation', - 'responsibilities', - 'salaryCurrency', - 'securityClearanceRequirement', - 'sensoryRequirement', - 'skills', - 'specialCommitments', - 'title', - 'totalJobOpenings', - 'validThrough', - 'workHours' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'applicantLocationRequirements' => ['AdministrativeArea'], - 'applicationContact' => ['ContactPoint'], - 'baseSalary' => ['MonetaryAmount', 'Number', 'PriceSpecification'], - 'datePosted' => ['Date', 'DateTime'], - 'educationRequirements' => ['EducationalOccupationalCredential', 'Text'], - 'employerOverview' => ['Text'], - 'employmentType' => ['Text'], - 'employmentUnit' => ['Organization'], - 'estimatedSalary' => ['MonetaryAmount', 'MonetaryAmountDistribution', 'Number'], - 'experienceRequirements' => ['Text'], - 'hiringOrganization' => ['Organization'], - 'incentiveCompensation' => ['Text'], - 'industry' => ['DefinedTerm', 'Text'], - 'jobBenefits' => ['Text'], - 'jobImmediateStart' => ['Boolean'], - 'jobLocation' => ['Place'], - 'jobLocationType' => ['Text'], - 'jobStartDate' => ['Date', 'Text'], - 'occupationalCategory' => ['CategoryCode', 'Text'], - 'physicalRequirement' => ['DefinedTerm', 'Text', 'URL'], - 'qualifications' => ['EducationalOccupationalCredential', 'Text'], - 'relevantOccupation' => ['Occupation'], - 'responsibilities' => ['Text'], - 'salaryCurrency' => ['Text'], - 'securityClearanceRequirement' => ['Text', 'URL'], - 'sensoryRequirement' => ['DefinedTerm', 'Text', 'URL'], - 'skills' => ['DefinedTerm', 'Text'], - 'specialCommitments' => ['Text'], - 'title' => ['Text'], - 'totalJobOpenings' => ['Integer'], - 'validThrough' => ['Date', 'DateTime'], - 'workHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'applicantLocationRequirements' => 'The location(s) applicants can apply from. This is usually used for telecommuting jobs where the applicant does not need to be in a physical office. Note: This should not be used for citizenship or work visa requirements.', - 'applicationContact' => 'Contact details for further information relevant to this job posting.', - 'baseSalary' => 'The base salary of the job or of an employee in an EmployeeRole.', - 'datePosted' => 'Publication date of an online listing.', - 'educationRequirements' => 'Educational background needed for the position or Occupation.', - 'employerOverview' => 'A description of the employer, career opportunities and work environment for this position.', - 'employmentType' => 'Type of employment (e.g. full-time, part-time, contract, temporary, seasonal, internship).', - 'employmentUnit' => 'Indicates the department, unit and/or facility where the employee reports and/or in which the job is to be performed.', - 'estimatedSalary' => 'An estimated salary for a job posting or occupation, based on a variety of variables including, but not limited to industry, job title, and location. Estimated salaries are often computed by outside organizations rather than the hiring organization, who may not have committed to the estimated value.', - 'experienceRequirements' => 'Description of skills and experience needed for the position or Occupation.', - 'hiringOrganization' => 'Organization offering the job position.', - 'incentiveCompensation' => 'Description of bonus and commission compensation aspects of the job. Supersedes incentives.', - 'industry' => 'The industry associated with the job position.', - 'jobBenefits' => 'Description of benefits associated with the job. Supersedes benefits.', - 'jobImmediateStart' => 'An indicator as to whether a position is available for an immediate start.', - 'jobLocation' => 'A (typically single) geographic location associated with the job position.', - 'jobLocationType' => 'A description of the job location (e.g TELECOMMUTE for telecommute jobs).', - 'jobStartDate' => 'The date on which a successful applicant for this job would be expected to start work. Choose a specific date in the future or use the jobImmediateStart property to indicate the position is to be filled as soon as possible.', - 'occupationalCategory' => 'A category describing the job, preferably using a term from a taxonomy such as BLS O*NET-SOC, ISCO-08 or similar, with the property repeated for each applicable value. Ideally the taxonomy should be identified, and both the textual label and formal code for the category should be provided. Note: for historical reasons, any textual label and formal code provided as a literal may be assumed to be from O*NET-SOC.', - 'physicalRequirement' => 'A description of the types of physical activity associated with the job. Defined terms such as those in O*net may be used, but note that there is no way to specify the level of ability as well as its nature when using a defined term.', - 'qualifications' => 'Specific qualifications required for this role or Occupation.', - 'relevantOccupation' => 'The Occupation for the JobPosting.', - 'responsibilities' => 'Responsibilities associated with this role or Occupation.', - 'salaryCurrency' => 'The currency (coded using ISO 4217 ) used for the main salary information in this job posting or for this employee.', - 'securityClearanceRequirement' => 'A description of any security clearance requirements of the job.', - 'sensoryRequirement' => 'A description of any sensory requirements and levels necessary to function on the job, including hearing and vision. Defined terms such as those in O*net may be used, but note that there is no way to specify the level of ability as well as its nature when using a defined term.', - 'skills' => 'A statement of knowledge, skill, ability, task or any other assertion expressing a competency that is desired or required to fulfill this role or to work in this occupation.', - 'specialCommitments' => 'Any special commitments associated with this job posting. Valid entries include VeteranCommit, MilitarySpouseCommit, etc.', - 'title' => 'The title of the job.', - 'totalJobOpenings' => 'The number of positions open for this job posting. Use a positive integer. Do not use if the number of positions is unclear or not known.', - 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', - 'workHours' => 'The typical working hours for this job (e.g. 1st shift, night shift, 8am-5pm).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The location(s) applicants can apply from. This is usually used for - * telecommuting jobs where the applicant does not need to be in a physical - * office. Note: This should not be used for citizenship or work visa - * requirements. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] - */ - public $applicantLocationRequirements; - /** - * Contact details for further information relevant to this job posting. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $applicationContact; - /** - * The base salary of the job or of an employee in an EmployeeRole. - * - * @var mixed|MonetaryAmount|float|PriceSpecification [schema.org types: MonetaryAmount, Number, PriceSpecification] - */ - public $baseSalary; - /** - * Publication date of an online listing. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePosted; - /** - * Educational background needed for the position or Occupation. - * - * @var mixed|EducationalOccupationalCredential|string [schema.org types: EducationalOccupationalCredential, Text] - */ - public $educationRequirements; - /** - * A description of the employer, career opportunities and work environment - * for this position. - * - * @var string [schema.org types: Text] - */ - public $employerOverview; - /** - * Type of employment (e.g. full-time, part-time, contract, temporary, - * seasonal, internship). - * - * @var string [schema.org types: Text] - */ - public $employmentType; - /** - * Indicates the department, unit and/or facility where the employee reports - * and/or in which the job is to be performed. - * - * @var Organization [schema.org types: Organization] - */ - public $employmentUnit; - /** - * An estimated salary for a job posting or occupation, based on a variety of - * variables including, but not limited to industry, job title, and location. - * Estimated salaries are often computed by outside organizations rather than - * the hiring organization, who may not have committed to the estimated value. - * - * @var mixed|MonetaryAmount|MonetaryAmountDistribution|float [schema.org types: MonetaryAmount, MonetaryAmountDistribution, Number] - */ - public $estimatedSalary; - /** - * Description of skills and experience needed for the position or Occupation. - * - * @var string [schema.org types: Text] - */ - public $experienceRequirements; - /** - * Organization offering the job position. - * - * @var Organization [schema.org types: Organization] - */ - public $hiringOrganization; /** - * Description of bonus and commission compensation aspects of the job. - * Supersedes incentives. - * - * @var string [schema.org types: Text] - */ - public $incentiveCompensation; - /** - * The industry associated with the job position. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $industry; - /** - * Description of benefits associated with the job. Supersedes benefits. - * - * @var string [schema.org types: Text] - */ - public $jobBenefits; - /** - * An indicator as to whether a position is available for an immediate start. - * - * @var bool [schema.org types: Boolean] - */ - public $jobImmediateStart; - /** - * A (typically single) geographic location associated with the job position. - * - * @var Place [schema.org types: Place] - */ - public $jobLocation; - /** - * A description of the job location (e.g TELECOMMUTE for telecommute jobs). - * - * @var string [schema.org types: Text] - */ - public $jobLocationType; - /** - * The date on which a successful applicant for this job would be expected to - * start work. Choose a specific date in the future or use the - * jobImmediateStart property to indicate the position is to be filled as soon - * as possible. - * - * @var mixed|Date|string [schema.org types: Date, Text] - */ - public $jobStartDate; - /** - * A category describing the job, preferably using a term from a taxonomy such - * as BLS O*NET-SOC, ISCO-08 or similar, with the property repeated for each - * applicable value. Ideally the taxonomy should be identified, and both the - * textual label and formal code for the category should be provided. Note: - * for historical reasons, any textual label and formal code provided as a - * literal may be assumed to be from O*NET-SOC. - * - * @var mixed|CategoryCode|string [schema.org types: CategoryCode, Text] - */ - public $occupationalCategory; - /** - * A description of the types of physical activity associated with the job. - * Defined terms such as those in O*net may be used, but note that there is no - * way to specify the level of ability as well as its nature when using a - * defined term. - * - * @var mixed|DefinedTerm|string|string [schema.org types: DefinedTerm, Text, URL] - */ - public $physicalRequirement; - /** - * Specific qualifications required for this role or Occupation. - * - * @var mixed|EducationalOccupationalCredential|string [schema.org types: EducationalOccupationalCredential, Text] - */ - public $qualifications; - /** - * The Occupation for the JobPosting. - * - * @var Occupation [schema.org types: Occupation] - */ - public $relevantOccupation; - /** - * Responsibilities associated with this role or Occupation. - * - * @var string [schema.org types: Text] - */ - public $responsibilities; - /** - * The currency (coded using ISO 4217 ) used for the main salary information - * in this job posting or for this employee. - * - * @var string [schema.org types: Text] - */ - public $salaryCurrency; - /** - * A description of any security clearance requirements of the job. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $securityClearanceRequirement; - /** - * A description of any sensory requirements and levels necessary to function - * on the job, including hearing and vision. Defined terms such as those in - * O*net may be used, but note that there is no way to specify the level of - * ability as well as its nature when using a defined term. - * - * @var mixed|DefinedTerm|string|string [schema.org types: DefinedTerm, Text, URL] - */ - public $sensoryRequirement; - /** - * A statement of knowledge, skill, ability, task or any other assertion - * expressing a competency that is desired or required to fulfill this role or - * to work in this occupation. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] + * @inheritdoc */ - public $skills; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'applicantLocationRequirements' => 'The location(s) applicants can apply from. This is usually used for telecommuting jobs where the applicant does not need to be in a physical office. Note: This should not be used for citizenship or work visa requirements.', + 'applicationContact' => 'Contact details for further information relevant to this job posting.', + 'baseSalary' => 'The base salary of the job or of an employee in an EmployeeRole.', + 'benefits' => 'Description of benefits associated with the job.', + 'datePosted' => 'Publication date of an online listing.', + 'description' => 'A description of the item.', + 'directApply' => 'Indicates whether an [[url]] that is associated with a [[JobPosting]] enables direct application for the job, via the posting website. A job posting is considered to have directApply of [[True]] if an application process for the specified job can be directly initiated via the url(s) given (noting that e.g. multiple internet domains might nevertheless be involved at an implementation level). A value of [[False]] is appropriate if there is no clear path to applying directly online for the specified job, navigating directly from the JobPosting url(s) supplied.', + '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.', + 'educationRequirements' => 'Educational background needed for the position or Occupation.', + 'eligibilityToWorkRequirement' => 'The legal requirements such as citizenship, visa and other documentation required for an applicant to this job.', + 'employerOverview' => 'A description of the employer, career opportunities and work environment for this position.', + 'employmentType' => 'Type of employment (e.g. full-time, part-time, contract, temporary, seasonal, internship).', + 'employmentUnit' => 'Indicates the department, unit and/or facility where the employee reports and/or in which the job is to be performed.', + 'estimatedSalary' => 'An estimated salary for a job posting or occupation, based on a variety of variables including, but not limited to industry, job title, and location. Estimated salaries are often computed by outside organizations rather than the hiring organization, who may not have committed to the estimated value.', + 'experienceInPlaceOfEducation' => 'Indicates whether a [[JobPosting]] will accept experience (as indicated by [[OccupationalExperienceRequirements]]) in place of its formal educational qualifications (as indicated by [[educationRequirements]]). If true, indicates that satisfying one of these requirements is sufficient.', + 'experienceRequirements' => 'Description of skills and experience needed for the position or Occupation.', + 'hiringOrganization' => 'Organization offering the job position.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'incentiveCompensation' => 'Description of bonus and commission compensation aspects of the job.', + 'incentives' => 'Description of bonus and commission compensation aspects of the job.', + 'industry' => 'The industry associated with the job position.', + 'jobBenefits' => 'Description of benefits associated with the job.', + 'jobImmediateStart' => 'An indicator as to whether a position is available for an immediate start.', + 'jobLocation' => 'A (typically single) geographic location associated with the job position.', + 'jobLocationType' => 'A description of the job location (e.g TELECOMMUTE for telecommute jobs).', + 'jobStartDate' => 'The date on which a successful applicant for this job would be expected to start work. Choose a specific date in the future or use the jobImmediateStart property to indicate the position is to be filled as soon as possible.', + '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.', + 'name' => 'The name of the item.', + 'occupationalCategory' => 'A category describing the job, preferably using a term from a taxonomy such as [BLS O*NET-SOC](http://www.onetcenter.org/taxonomy.html), [ISCO-08](https://www.ilo.org/public/english/bureau/stat/isco/isco08/) or similar, with the property repeated for each applicable value. Ideally the taxonomy should be identified, and both the textual label and formal code for the category should be provided. Note: for historical reasons, any textual label and formal code provided as a literal may be assumed to be from O*NET-SOC.', + 'physicalRequirement' => 'A description of the types of physical activity associated with the job. Defined terms such as those in O*net may be used, but note that there is no way to specify the level of ability as well as its nature when using a defined term.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'qualifications' => 'Specific qualifications required for this role or Occupation.', + 'relevantOccupation' => 'The Occupation for the JobPosting.', + 'responsibilities' => 'Responsibilities associated with this role or Occupation.', + 'salaryCurrency' => 'The currency (coded using [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) ) used for the main salary information in this job posting or for this employee.', + '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.', + 'securityClearanceRequirement' => 'A description of any security clearance requirements of the job.', + 'sensoryRequirement' => 'A description of any sensory requirements and levels necessary to function on the job, including hearing and vision. Defined terms such as those in O*net may be used, but note that there is no way to specify the level of ability as well as its nature when using a defined term.', + 'skills' => 'A statement of knowledge, skill, ability, task or any other assertion expressing a competency that is desired or required to fulfill this role or to work in this occupation.', + 'specialCommitments' => 'Any special commitments associated with this job posting. Valid entries include VeteranCommit, MilitarySpouseCommit, etc.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'title' => 'The title of the job.', + 'totalJobOpenings' => 'The number of positions open for this job posting. Use a positive integer. Do not use if the number of positions is unclear or not known.', + 'url' => 'URL of the item.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'workHours' => 'The typical working hours for this job (e.g. 1st shift, night shift, 8am-5pm).' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Any special commitments associated with this job posting. Valid entries - * include VeteranCommit, MilitarySpouseCommit, etc. - * - * @var string [schema.org types: Text] - */ - public $specialCommitments; - /** - * The title of the job. - * - * @var string [schema.org types: Text] - */ - public $title; - /** - * The number of positions open for this job posting. Use a positive integer. - * Do not use if the number of positions is unclear or not known. - * - * @var int [schema.org types: Integer] - */ - public $totalJobOpenings; /** - * The date after when the item is not valid. For example the end of an offer, - * salary period, or a period of opening hours. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validThrough; - /** - * The typical working hours for this job (e.g. 1st shift, night shift, - * 8am-5pm). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $workHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['applicantLocationRequirements', 'applicationContact', 'baseSalary', 'datePosted', 'educationRequirements', 'employerOverview', 'employmentType', 'employmentUnit', 'estimatedSalary', 'experienceRequirements', 'hiringOrganization', 'incentiveCompensation', 'industry', 'jobBenefits', 'jobImmediateStart', 'jobLocation', 'jobLocationType', 'jobStartDate', 'occupationalCategory', 'physicalRequirement', 'qualifications', 'relevantOccupation', 'responsibilities', 'salaryCurrency', 'securityClearanceRequirement', 'sensoryRequirement', 'skills', 'specialCommitments', 'title', 'totalJobOpenings', 'validThrough', 'workHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/JobPostingInterface.php b/src/models/jsonld/JobPostingInterface.php new file mode 100644 index 000000000..ea3037ebf --- /dev/null +++ b/src/models/jsonld/JobPostingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'event' => ['Event'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'event' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'event' => ['Event'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $event; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['event'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/JoinActionInterface.php b/src/models/jsonld/JoinActionInterface.php new file mode 100644 index 000000000..adbc255e5 --- /dev/null +++ b/src/models/jsonld/JoinActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'biomechnicalClass' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'functionalClass' => ['Text', 'MedicalEntity'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'structuralClass' => ['Text'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'biomechnicalClass', - 'functionalClass', - 'structuralClass' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'biomechnicalClass' => ['Text'], - 'functionalClass' => ['MedicalEntity', 'Text'], - 'structuralClass' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'biomechnicalClass' => 'The biomechanical properties of the bone.', - 'functionalClass' => 'The degree of mobility the joint allows.', - 'structuralClass' => 'The name given to how bone physically connects to each other.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'biomechnicalClass' => 'The biomechanical properties of the bone.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'functionalClass' => 'The degree of mobility the joint allows.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'structuralClass' => 'The name given to how bone physically connects to each other.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The biomechanical properties of the bone. - * - * @var string [schema.org types: Text] - */ - public $biomechnicalClass; - /** - * The degree of mobility the joint allows. - * - * @var mixed|MedicalEntity|string [schema.org types: MedicalEntity, Text] - */ - public $functionalClass; /** - * The name given to how bone physically connects to each other. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $structuralClass; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['biomechnicalClass', 'functionalClass', 'structuralClass'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/JointInterface.php b/src/models/jsonld/JointInterface.php new file mode 100644 index 000000000..ee00c2cda --- /dev/null +++ b/src/models/jsonld/JointInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/KosherDietInterface.php b/src/models/jsonld/KosherDietInterface.php new file mode 100644 index 000000000..453a482d8 --- /dev/null +++ b/src/models/jsonld/KosherDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LaboratoryScienceInterface.php b/src/models/jsonld/LaboratoryScienceInterface.php new file mode 100644 index 000000000..fface3d36 --- /dev/null +++ b/src/models/jsonld/LaboratoryScienceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LakeBodyOfWaterInterface.php b/src/models/jsonld/LakeBodyOfWaterInterface.php new file mode 100644 index 000000000..7bda8bf98 --- /dev/null +++ b/src/models/jsonld/LakeBodyOfWaterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place. The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number. The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. The International Standard of Industrial Classification - * of All Economic Activities (ISIC), Revision 4 code for a particular - * organization, business person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LandformInterface.php b/src/models/jsonld/LandformInterface.php new file mode 100644 index 000000000..ac1b0e821 --- /dev/null +++ b/src/models/jsonld/LandformInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place. The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number. The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. The International Standard of Industrial Classification - * of All Economic Activities (ISIC), Revision 4 code for a particular - * organization, business person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LandmarksOrHistoricalBuildingsInterface.php b/src/models/jsonld/LandmarksOrHistoricalBuildingsInterface.php new file mode 100644 index 000000000..fb10c940e --- /dev/null +++ b/src/models/jsonld/LandmarksOrHistoricalBuildingsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LanguageInterface.php b/src/models/jsonld/LanguageInterface.php new file mode 100644 index 000000000..ea589d653 --- /dev/null +++ b/src/models/jsonld/LanguageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LaserDiscFormatInterface.php b/src/models/jsonld/LaserDiscFormatInterface.php new file mode 100644 index 000000000..7ede9a2d5 --- /dev/null +++ b/src/models/jsonld/LaserDiscFormatInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'competencyRequired' => ['Text', 'DefinedTerm', 'URL'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'competencyRequired' => 'Knowledge, skill, ability or personal attribute that must be demonstrated by a person or other entity in order to do something such as earn an Educational Occupational Credential or understand a LearningResource.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/LearningResourceInterface.php b/src/models/jsonld/LearningResourceInterface.php new file mode 100644 index 000000000..c58383e16 --- /dev/null +++ b/src/models/jsonld/LearningResourceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'event' => ['Event'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'event' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'event' => ['Event'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $event; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['event'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LeaveActionInterface.php b/src/models/jsonld/LeaveActionInterface.php new file mode 100644 index 000000000..60533850a --- /dev/null +++ b/src/models/jsonld/LeaveActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LeftHandDrivingInterface.php b/src/models/jsonld/LeftHandDrivingInterface.php new file mode 100644 index 000000000..85de80ddd --- /dev/null +++ b/src/models/jsonld/LeftHandDrivingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LegalForceStatusInterface.php b/src/models/jsonld/LegalForceStatusInterface.php new file mode 100644 index 000000000..afa6fa000 --- /dev/null +++ b/src/models/jsonld/LegalForceStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LegalServiceInterface.php b/src/models/jsonld/LegalServiceInterface.php new file mode 100644 index 000000000..3980d1558 --- /dev/null +++ b/src/models/jsonld/LegalServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LegalValueLevelInterface.php b/src/models/jsonld/LegalValueLevelInterface.php new file mode 100644 index 000000000..3d1bb9987 --- /dev/null +++ b/src/models/jsonld/LegalValueLevelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'jurisdiction' => ['Text', 'AdministrativeArea'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'legislationApplies' => ['Legislation'], + 'legislationChanges' => ['Legislation'], + 'legislationConsolidates' => ['Legislation'], + 'legislationDate' => ['Date'], + 'legislationDateVersion' => ['Date'], + 'legislationIdentifier' => ['Text', 'URL'], + 'legislationJurisdiction' => ['AdministrativeArea', 'Text'], + 'legislationLegalForce' => ['LegalForceStatus'], + 'legislationPassedBy' => ['Person', 'Organization'], + 'legislationResponsible' => ['Organization', 'Person'], + 'legislationTransposes' => ['Legislation'], + 'legislationType' => ['CategoryCode', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'legislationApplies', - 'legislationChanges', - 'legislationConsolidates', - 'legislationDate', - 'legislationDateVersion', - 'legislationIdentifier', - 'legislationJurisdiction', - 'legislationLegalForce', - 'legislationPassedBy', - 'legislationResponsible', - 'legislationTransposes', - 'legislationType' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'legislationApplies' => ['Legislation'], - 'legislationChanges' => ['Legislation'], - 'legislationConsolidates' => ['Legislation'], - 'legislationDate' => ['Date'], - 'legislationDateVersion' => ['Date'], - 'legislationIdentifier' => ['Text', 'URL'], - 'legislationJurisdiction' => ['AdministrativeArea', 'Text'], - 'legislationLegalForce' => ['LegalForceStatus'], - 'legislationPassedBy' => ['Organization', 'Person'], - 'legislationResponsible' => ['Organization', 'Person'], - 'legislationTransposes' => ['Legislation'], - 'legislationType' => ['CategoryCode', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'legislationApplies' => 'Indicates that this legislation (or part of a legislation) somehow transfers another legislation in a different legislative context. This is an informative link, and it has no legal value. For legally-binding links of transposition, use the legislationTransposes property. For example an informative consolidated law of a European Union\'s member state "applies" the consolidated version of the European Directive implemented in it.', - 'legislationChanges' => 'Another legislation that this legislation changes. This encompasses the notions of amendment, replacement, correction, repeal, or other types of change. This may be a direct change (textual or non-textual amendment) or a consequential or indirect change. The property is to be used to express the existence of a change relationship between two acts rather than the existence of a consolidated version of the text that shows the result of the change. For consolidation relationships, use the legislationConsolidates property.', - 'legislationConsolidates' => 'Indicates another legislation taken into account in this consolidated legislation (which is usually the product of an editorial process that revises the legislation). This property should be used multiple times to refer to both the original version or the previous consolidated version, and to the legislations making the change.', - 'legislationDate' => 'The date of adoption or signature of the legislation. This is the date at which the text is officially aknowledged to be a legislation, even though it might not even be published or in force.', - 'legislationDateVersion' => 'The point-in-time at which the provided description of the legislation is valid (e.g. : when looking at the law on the 2016-04-07 (= dateVersion), I get the consolidation of 2015-04-12 of the "National Insurance Contributions Act 2015")', - 'legislationIdentifier' => 'An identifier for the legislation. This can be either a string-based identifier, like the CELEX at EU level or the NOR in France, or a web-based, URL/URI identifier, like an ELI (European Legislation Identifier) or an URN-Lex.', - 'legislationJurisdiction' => 'The jurisdiction from which the legislation originates.', - 'legislationLegalForce' => 'Whether the legislation is currently in force, not in force, or partially in force.', - 'legislationPassedBy' => 'The person or organization that originally passed or made the law : typically parliament (for primary legislation) or government (for secondary legislation). This indicates the "legal author" of the law, as opposed to its physical author.', - 'legislationResponsible' => 'An individual or organization that has some kind of responsibility for the legislation. Typically the ministry who is/was in charge of elaborating the legislation, or the adressee for potential questions about the legislation once it is published.', - 'legislationTransposes' => 'Indicates that this legislation (or part of legislation) fulfills the objectives set by another legislation, by passing appropriate implementation measures. Typically, some legislations of European Union\'s member states or regions transpose European Directives. This indicates a legally binding link between the 2 legislations.', - 'legislationType' => 'The type of the legislation. Examples of values are "law", "act", "directive", "decree", "regulation", "statutory instrument", "loi organique", "règlement grand-ducal", etc., depending on the country.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates that this legislation (or part of a legislation) somehow - * transfers another legislation in a different legislative context. This is - * an informative link, and it has no legal value. For legally-binding links - * of transposition, use the legislationTransposes property. For example an - * informative consolidated law of a European Union's member state "applies" - * the consolidated version of the European Directive implemented in it. - * - * @var Legislation [schema.org types: Legislation] - */ - public $legislationApplies; /** - * Another legislation that this legislation changes. This encompasses the - * notions of amendment, replacement, correction, repeal, or other types of - * change. This may be a direct change (textual or non-textual amendment) or a - * consequential or indirect change. The property is to be used to express the - * existence of a change relationship between two acts rather than the - * existence of a consolidated version of the text that shows the result of - * the change. For consolidation relationships, use the - * legislationConsolidates property. - * - * @var Legislation [schema.org types: Legislation] - */ - public $legislationChanges; - /** - * Indicates another legislation taken into account in this consolidated - * legislation (which is usually the product of an editorial process that - * revises the legislation). This property should be used multiple times to - * refer to both the original version or the previous consolidated version, - * and to the legislations making the change. - * - * @var Legislation [schema.org types: Legislation] - */ - public $legislationConsolidates; - /** - * The date of adoption or signature of the legislation. This is the date at - * which the text is officially aknowledged to be a legislation, even though - * it might not even be published or in force. - * - * @var Date [schema.org types: Date] - */ - public $legislationDate; - /** - * The point-in-time at which the provided description of the legislation is - * valid (e.g. : when looking at the law on the 2016-04-07 (= dateVersion), I - * get the consolidation of 2015-04-12 of the "National Insurance - * Contributions Act 2015") - * - * @var Date [schema.org types: Date] - */ - public $legislationDateVersion; - /** - * An identifier for the legislation. This can be either a string-based - * identifier, like the CELEX at EU level or the NOR in France, or a - * web-based, URL/URI identifier, like an ELI (European Legislation - * Identifier) or an URN-Lex. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $legislationIdentifier; - /** - * The jurisdiction from which the legislation originates. - * - * @var mixed|AdministrativeArea|string [schema.org types: AdministrativeArea, Text] + * @inheritdoc */ - public $legislationJurisdiction; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'jurisdiction' => 'Indicates a legal jurisdiction, e.g. of some legislation, or where some government service is based.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'legislationApplies' => 'Indicates that this legislation (or part of a legislation) somehow transfers another legislation in a different legislative context. This is an informative link, and it has no legal value. For legally-binding links of transposition, use the legislationTransposes property. For example an informative consolidated law of a European Union\'s member state "applies" the consolidated version of the European Directive implemented in it.', + 'legislationChanges' => 'Another legislation that this legislation changes. This encompasses the notions of amendment, replacement, correction, repeal, or other types of change. This may be a direct change (textual or non-textual amendment) or a consequential or indirect change. The property is to be used to express the existence of a change relationship between two acts rather than the existence of a consolidated version of the text that shows the result of the change. For consolidation relationships, use the legislationConsolidates property.', + 'legislationConsolidates' => 'Indicates another legislation taken into account in this consolidated legislation (which is usually the product of an editorial process that revises the legislation). This property should be used multiple times to refer to both the original version or the previous consolidated version, and to the legislations making the change.', + 'legislationDate' => 'The date of adoption or signature of the legislation. This is the date at which the text is officially aknowledged to be a legislation, even though it might not even be published or in force.', + 'legislationDateVersion' => 'The point-in-time at which the provided description of the legislation is valid (e.g. : when looking at the law on the 2016-04-07 (= dateVersion), I get the consolidation of 2015-04-12 of the "National Insurance Contributions Act 2015")', + 'legislationIdentifier' => 'An identifier for the legislation. This can be either a string-based identifier, like the CELEX at EU level or the NOR in France, or a web-based, URL/URI identifier, like an ELI (European Legislation Identifier) or an URN-Lex.', + 'legislationJurisdiction' => 'The jurisdiction from which the legislation originates.', + 'legislationLegalForce' => 'Whether the legislation is currently in force, not in force, or partially in force.', + 'legislationPassedBy' => 'The person or organization that originally passed or made the law : typically parliament (for primary legislation) or government (for secondary legislation). This indicates the "legal author" of the law, as opposed to its physical author.', + 'legislationResponsible' => 'An individual or organization that has some kind of responsibility for the legislation. Typically the ministry who is/was in charge of elaborating the legislation, or the adressee for potential questions about the legislation once it is published.', + 'legislationTransposes' => 'Indicates that this legislation (or part of legislation) fulfills the objectives set by another legislation, by passing appropriate implementation measures. Typically, some legislations of European Union\'s member states or regions transpose European Directives. This indicates a legally binding link between the 2 legislations.', + 'legislationType' => 'The type of the legislation. Examples of values are "law", "act", "directive", "decree", "regulation", "statutory instrument", "loi organique", "règlement grand-ducal", etc., depending on the country.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Whether the legislation is currently in force, not in force, or partially - * in force. - * - * @var LegalForceStatus [schema.org types: LegalForceStatus] - */ - public $legislationLegalForce; - /** - * The person or organization that originally passed or made the law : - * typically parliament (for primary legislation) or government (for secondary - * legislation). This indicates the "legal author" of the law, as opposed to - * its physical author. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $legislationPassedBy; - /** - * An individual or organization that has some kind of responsibility for the - * legislation. Typically the ministry who is/was in charge of elaborating the - * legislation, or the adressee for potential questions about the legislation - * once it is published. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $legislationResponsible; - /** - * Indicates that this legislation (or part of legislation) fulfills the - * objectives set by another legislation, by passing appropriate - * implementation measures. Typically, some legislations of European Union's - * member states or regions transpose European Directives. This indicates a - * legally binding link between the 2 legislations. - * - * @var Legislation [schema.org types: Legislation] - */ - public $legislationTransposes; /** - * The type of the legislation. Examples of values are "law", "act", - * "directive", "decree", "regulation", "statutory instrument", "loi - * organique", "règlement grand-ducal", etc., depending on the country. - * - * @var mixed|CategoryCode|string [schema.org types: CategoryCode, Text] + * @inheritdoc */ - public $legislationType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['legislationApplies', 'legislationChanges', 'legislationConsolidates', 'legislationDate', 'legislationDateVersion', 'legislationIdentifier', 'legislationJurisdiction', 'legislationLegalForce', 'legislationPassedBy', 'legislationResponsible', 'legislationTransposes', 'legislationType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LegislationInterface.php b/src/models/jsonld/LegislationInterface.php new file mode 100644 index 000000000..a53f0050b --- /dev/null +++ b/src/models/jsonld/LegislationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'jurisdiction' => ['Text', 'AdministrativeArea'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'legislationApplies' => ['Legislation'], + 'legislationChanges' => ['Legislation'], + 'legislationConsolidates' => ['Legislation'], + 'legislationDate' => ['Date'], + 'legislationDateVersion' => ['Date'], + 'legislationIdentifier' => ['Text', 'URL'], + 'legislationJurisdiction' => ['AdministrativeArea', 'Text'], + 'legislationLegalForce' => ['LegalForceStatus'], + 'legislationLegalValue' => ['LegalValueLevel'], + 'legislationPassedBy' => ['Person', 'Organization'], + 'legislationResponsible' => ['Organization', 'Person'], + 'legislationTransposes' => ['Legislation'], + 'legislationType' => ['CategoryCode', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'legislationLegalValue' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'jurisdiction' => 'Indicates a legal jurisdiction, e.g. of some legislation, or where some government service is based.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'legislationApplies' => 'Indicates that this legislation (or part of a legislation) somehow transfers another legislation in a different legislative context. This is an informative link, and it has no legal value. For legally-binding links of transposition, use the legislationTransposes property. For example an informative consolidated law of a European Union\'s member state "applies" the consolidated version of the European Directive implemented in it.', + 'legislationChanges' => 'Another legislation that this legislation changes. This encompasses the notions of amendment, replacement, correction, repeal, or other types of change. This may be a direct change (textual or non-textual amendment) or a consequential or indirect change. The property is to be used to express the existence of a change relationship between two acts rather than the existence of a consolidated version of the text that shows the result of the change. For consolidation relationships, use the legislationConsolidates property.', + 'legislationConsolidates' => 'Indicates another legislation taken into account in this consolidated legislation (which is usually the product of an editorial process that revises the legislation). This property should be used multiple times to refer to both the original version or the previous consolidated version, and to the legislations making the change.', + 'legislationDate' => 'The date of adoption or signature of the legislation. This is the date at which the text is officially aknowledged to be a legislation, even though it might not even be published or in force.', + 'legislationDateVersion' => 'The point-in-time at which the provided description of the legislation is valid (e.g. : when looking at the law on the 2016-04-07 (= dateVersion), I get the consolidation of 2015-04-12 of the "National Insurance Contributions Act 2015")', + 'legislationIdentifier' => 'An identifier for the legislation. This can be either a string-based identifier, like the CELEX at EU level or the NOR in France, or a web-based, URL/URI identifier, like an ELI (European Legislation Identifier) or an URN-Lex.', + 'legislationJurisdiction' => 'The jurisdiction from which the legislation originates.', + 'legislationLegalForce' => 'Whether the legislation is currently in force, not in force, or partially in force.', + 'legislationLegalValue' => 'The legal value of this legislation file. The same legislation can be written in multiple files with different legal values. Typically a digitally signed PDF have a "stronger" legal value than the HTML file of the same act.', + 'legislationPassedBy' => 'The person or organization that originally passed or made the law : typically parliament (for primary legislation) or government (for secondary legislation). This indicates the "legal author" of the law, as opposed to its physical author.', + 'legislationResponsible' => 'An individual or organization that has some kind of responsibility for the legislation. Typically the ministry who is/was in charge of elaborating the legislation, or the adressee for potential questions about the legislation once it is published.', + 'legislationTransposes' => 'Indicates that this legislation (or part of legislation) fulfills the objectives set by another legislation, by passing appropriate implementation measures. Typically, some legislations of European Union\'s member states or regions transpose European Directives. This indicates a legally binding link between the 2 legislations.', + 'legislationType' => 'The type of the legislation. Examples of values are "law", "act", "directive", "decree", "regulation", "statutory instrument", "loi organique", "règlement grand-ducal", etc., depending on the country.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'legislationLegalValue' => ['LegalValueLevel'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'legislationLegalValue' => 'The legal value of this legislation file. The same legislation can be written in multiple files with different legal values. Typically a digitally signed PDF have a "stronger" legal value than the HTML file of the same act.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The legal value of this legislation file. The same legislation can be - * written in multiple files with different legal values. Typically a - * digitally signed PDF have a "stronger" legal value than the HTML file of - * the same act. - * - * @var LegalValueLevel [schema.org types: LegalValueLevel] + * @inheritdoc */ - public $legislationLegalValue; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['legislationLegalValue'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LegislationObjectInterface.php b/src/models/jsonld/LegislationObjectInterface.php new file mode 100644 index 000000000..b3a25762a --- /dev/null +++ b/src/models/jsonld/LegislationObjectInterface.php @@ -0,0 +1,24 @@ +legislationConsolidates property. + * + * @var Legislation + */ + public $legislationChanges; + + /** + * An individual or organization that has some kind of responsibility for the + * legislation. Typically the ministry who is/was in charge of elaborating the + * legislation, or the adressee for potential questions about the legislation + * once it is published. + * + * @var Organization|Person + */ + public $legislationResponsible; + + /** + * The jurisdiction from which the legislation originates. + * + * @var string|AdministrativeArea|Text + */ + public $legislationJurisdiction; + + /** + * The date of adoption or signature of the legislation. This is the date at + * which the text is officially aknowledged to be a legislation, even though + * it might not even be published or in force. + * + * @var Date + */ + public $legislationDate; + + /** + * The person or organization that originally passed or made the law : + * typically parliament (for primary legislation) or government (for secondary + * legislation). This indicates the "legal author" of the law, as opposed to + * its physical author. + * + * @var Person|Organization + */ + public $legislationPassedBy; + + /** + * Indicates another legislation taken into account in this consolidated + * legislation (which is usually the product of an editorial process that + * revises the legislation). This property should be used multiple times to + * refer to both the original version or the previous consolidated version, + * and to the legislations making the change. + * + * @var Legislation + */ + public $legislationConsolidates; + + /** + * Indicates that this legislation (or part of a legislation) somehow + * transfers another legislation in a different legislative context. This is + * an informative link, and it has no legal value. For legally-binding links + * of transposition, use the legislationTransposes property. For + * example an informative consolidated law of a European Union's member state + * "applies" the consolidated version of the European Directive implemented in + * it. + * + * @var Legislation + */ + public $legislationApplies; + + /** + * The point-in-time at which the provided description of the legislation is + * valid (e.g. : when looking at the law on the 2016-04-07 (= dateVersion), I + * get the consolidation of 2015-04-12 of the "National Insurance + * Contributions Act 2015") + * + * @var Date + */ + public $legislationDateVersion; + +} diff --git a/src/models/jsonld/LegislativeBuilding.php b/src/models/jsonld/LegislativeBuilding.php index 870a33729..ad31c8f42 100644 --- a/src/models/jsonld/LegislativeBuilding.php +++ b/src/models/jsonld/LegislativeBuilding.php @@ -1,28 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LegislativeBuildingInterface.php b/src/models/jsonld/LegislativeBuildingInterface.php new file mode 100644 index 000000000..94520437b --- /dev/null +++ b/src/models/jsonld/LegislativeBuildingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LeisureTimeActivityInterface.php b/src/models/jsonld/LeisureTimeActivityInterface.php new file mode 100644 index 000000000..c8655f459 --- /dev/null +++ b/src/models/jsonld/LeisureTimeActivityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'borrower' => ['Person'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'borrower' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'borrower' => 'A sub property of participant. The person that borrows the object being lent.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'borrower' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'borrower' => 'A sub property of participant. The person that borrows the object being lent.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The person that borrows the object being - * lent. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $borrower; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['borrower'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LendActionInterface.php b/src/models/jsonld/LendActionInterface.php new file mode 100644 index 000000000..27f54e7c3 --- /dev/null +++ b/src/models/jsonld/LendActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LibraryInterface.php b/src/models/jsonld/LibraryInterface.php new file mode 100644 index 000000000..a7f49759c --- /dev/null +++ b/src/models/jsonld/LibraryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LibrarySystemInterface.php b/src/models/jsonld/LibrarySystemInterface.php new file mode 100644 index 000000000..8a95aa028 --- /dev/null +++ b/src/models/jsonld/LibrarySystemInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'code', - 'guideline', - 'legalStatus', - 'medicineSystem', - 'recognizingAuthority', - 'relevantSpecialty', - 'study' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'code' => ['MedicalCode'], - 'guideline' => ['MedicalGuideline'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'medicineSystem' => ['MedicineSystem'], - 'recognizingAuthority' => ['Organization'], - 'relevantSpecialty' => ['MedicalSpecialty'], - 'study' => ['MedicalStudy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', - 'guideline' => 'A medical guideline related to this entity.', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', - 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', - 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', - 'study' => 'A medical study or trial related to this entity.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical code for the entity, taken from a controlled vocabulary or - * ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. - * - * @var MedicalCode [schema.org types: MedicalCode] - */ - public $code; - /** - * A medical guideline related to this entity. - * - * @var MedicalGuideline [schema.org types: MedicalGuideline] + * @inheritdoc */ - public $guideline; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The system of medicine that includes this MedicalEntity, for example - * 'evidence-based', 'homeopathic', 'chiropractic', etc. - * - * @var MedicineSystem [schema.org types: MedicineSystem] - */ - public $medicineSystem; - /** - * If applicable, the organization that officially recognizes this entity as - * part of its endorsed system of medicine. - * - * @var Organization [schema.org types: Organization] - */ - public $recognizingAuthority; - /** - * If applicable, a medical specialty in which this entity is relevant. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] - */ - public $relevantSpecialty; /** - * A medical study or trial related to this entity. - * - * @var MedicalStudy [schema.org types: MedicalStudy] + * @inheritdoc */ - public $study; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['code', 'guideline', 'legalStatus', 'medicineSystem', 'recognizingAuthority', 'relevantSpecialty', 'study'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LifestyleModificationInterface.php b/src/models/jsonld/LifestyleModificationInterface.php new file mode 100644 index 000000000..f0df62f0b --- /dev/null +++ b/src/models/jsonld/LifestyleModificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedPathophysiology', - 'bodyLocation', - 'connectedTo', - 'diagram', - 'partOfSystem', - 'relatedCondition', - 'relatedTherapy', - 'subStructure' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedPathophysiology' => ['Text'], - 'bodyLocation' => ['Text'], - 'connectedTo' => ['AnatomicalStructure'], - 'diagram' => ['ImageObject'], - 'partOfSystem' => ['AnatomicalSystem'], - 'relatedCondition' => ['MedicalCondition'], - 'relatedTherapy' => ['MedicalTherapy'], - 'subStructure' => ['AnatomicalStructure'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', - 'bodyLocation' => 'Location in the body of the anatomical structure.', - 'connectedTo' => 'Other anatomical structures to which this structure is connected.', - 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', - 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', - 'relatedCondition' => 'A medical condition associated with this anatomy.', - 'relatedTherapy' => 'A medical therapy related to this anatomy.', - 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * If applicable, a description of the pathophysiology associated with the - * anatomical system, including potential abnormal changes in the mechanical, - * physical, and biochemical functions of the system. - * - * @var string [schema.org types: Text] - */ - public $associatedPathophysiology; - /** - * Location in the body of the anatomical structure. - * - * @var string [schema.org types: Text] - */ - public $bodyLocation; - /** - * Other anatomical structures to which this structure is connected. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $connectedTo; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * An image containing a diagram that illustrates the structure and/or its - * component substructures and/or connections with other structures. - * - * @var ImageObject [schema.org types: ImageObject] - */ - public $diagram; - /** - * The anatomical or organ system that this structure is part of. - * - * @var AnatomicalSystem [schema.org types: AnatomicalSystem] - */ - public $partOfSystem; - /** - * A medical condition associated with this anatomy. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $relatedCondition; /** - * A medical therapy related to this anatomy. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $relatedTherapy; - /** - * Component (sub-)structure(s) that comprise this anatomical structure. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $subStructure; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedPathophysiology', 'bodyLocation', 'connectedTo', 'diagram', 'partOfSystem', 'relatedCondition', 'relatedTherapy', 'subStructure'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LigamentInterface.php b/src/models/jsonld/LigamentInterface.php new file mode 100644 index 000000000..d38e81403 --- /dev/null +++ b/src/models/jsonld/LigamentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LikeActionInterface.php b/src/models/jsonld/LikeActionInterface.php new file mode 100644 index 000000000..3f98b5340 --- /dev/null +++ b/src/models/jsonld/LikeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LimitedAvailabilityInterface.php b/src/models/jsonld/LimitedAvailabilityInterface.php new file mode 100644 index 000000000..ac41444ef --- /dev/null +++ b/src/models/jsonld/LimitedAvailabilityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/LimitedByGuaranteeCharityInterface.php b/src/models/jsonld/LimitedByGuaranteeCharityInterface.php new file mode 100644 index 000000000..ab420f12d --- /dev/null +++ b/src/models/jsonld/LimitedByGuaranteeCharityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endDate' => ['Date', 'DateTime'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'linkRelationship' => ['Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'namedPosition' => ['Text', 'URL'], + 'potentialAction' => ['Action'], + 'roleName' => ['URL', 'Text'], + 'sameAs' => ['URL'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'inLanguage', - 'linkRelationship' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'inLanguage' => ['Language', 'Text'], - 'linkRelationship' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'linkRelationship' => 'Indicates the relationship type of a Web link. ', + '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.', + 'name' => 'The name of the item.', + 'namedPosition' => 'A position played, performed or filled by a person or organization, as part of an organization. For example, an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'roleName' => 'A role played, performed or filled by a person or organization. For example, the team of creators for a comic book might fill the roles named \'inker\', \'penciller\', and \'letterer\'; or an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. See also availableLanguage. Supersedes language.', - 'linkRelationship' => 'Indicates the relationship type of a Web link.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * Indicates the relationship type of a Web link. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $linkRelationship; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['inLanguage', 'linkRelationship'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LinkRoleInterface.php b/src/models/jsonld/LinkRoleInterface.php new file mode 100644 index 000000000..7fd4601ff --- /dev/null +++ b/src/models/jsonld/LinkRoleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LiquorStoreInterface.php b/src/models/jsonld/LiquorStoreInterface.php new file mode 100644 index 000000000..2925e8142 --- /dev/null +++ b/src/models/jsonld/LiquorStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'item' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nextItem' => ['ListItem'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'previousItem' => ['ListItem'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'item', - 'nextItem', - 'position', - 'previousItem' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'item' => ['Thing'], - 'nextItem' => ['ListItem'], - 'position' => ['Integer', 'Text'], - 'previousItem' => ['ListItem'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', - 'nextItem' => 'A link to the ListItem that follows the current one.', - 'position' => 'The position of an item in a series or sequence of items.', - 'previousItem' => 'A link to the ListItem that preceeds the current one.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'item' => 'An entity represented by an entry in a list or data feed (e.g. an \'artist\' in a list of \'artists\')’.', + '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.', + 'name' => 'The name of the item.', + 'nextItem' => 'A link to the ListItem that follows the current one.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'previousItem' => 'A link to the ListItem that preceeds the current one.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An entity represented by an entry in a list or data feed (e.g. an 'artist' - * in a list of 'artists')’. - * - * @var Thing [schema.org types: Thing] - */ - public $item; - /** - * A link to the ListItem that follows the current one. - * - * @var ListItem [schema.org types: ListItem] - */ - public $nextItem; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; /** - * A link to the ListItem that preceeds the current one. - * - * @var ListItem [schema.org types: ListItem] + * @inheritdoc */ - public $previousItem; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['item', 'nextItem', 'position', 'previousItem'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ListItemInterface.php b/src/models/jsonld/ListItemInterface.php new file mode 100644 index 000000000..47d951300 --- /dev/null +++ b/src/models/jsonld/ListItemInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ListPriceInterface.php b/src/models/jsonld/ListPriceInterface.php new file mode 100644 index 000000000..b02e59aef --- /dev/null +++ b/src/models/jsonld/ListPriceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ListenActionInterface.php b/src/models/jsonld/ListenActionInterface.php new file mode 100644 index 000000000..f82700f91 --- /dev/null +++ b/src/models/jsonld/ListenActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LiteraryEventInterface.php b/src/models/jsonld/LiteraryEventInterface.php new file mode 100644 index 000000000..fd0a46b07 --- /dev/null +++ b/src/models/jsonld/LiteraryEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LiveAlbumInterface.php b/src/models/jsonld/LiveAlbumInterface.php new file mode 100644 index 000000000..4c1b5bdb6 --- /dev/null +++ b/src/models/jsonld/LiveAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'coverageEndTime' => ['DateTime'], + 'coverageStartTime' => ['DateTime'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'liveBlogUpdate' => ['BlogPosting'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sharedContent' => ['CreativeWork'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'coverageEndTime', - 'coverageStartTime', - 'liveBlogUpdate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'coverageEndTime' => ['DateTime'], - 'coverageStartTime' => ['DateTime'], - 'liveBlogUpdate' => ['BlogPosting'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'coverageEndTime' => 'The time when the live blog will stop covering the Event. Note that coverage may continue after the Event concludes.', - 'coverageStartTime' => 'The time when the live blog will begin covering the Event. Note that coverage may begin before the Event\'s start time. The LiveBlogPosting may also be created before coverage begins.', - 'liveBlogUpdate' => 'An update to the LiveBlog.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'coverageEndTime' => 'The time when the live blog will stop covering the Event. Note that coverage may continue after the Event concludes.', + 'coverageStartTime' => 'The time when the live blog will begin covering the Event. Note that coverage may begin before the Event\'s start time. The LiveBlogPosting may also be created before coverage begins.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'liveBlogUpdate' => 'An update to the LiveBlog.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sharedContent' => 'A CreativeWork such as an image, video, or audio clip shared as part of this posting.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - 'coverageEndTime', - 'coverageStartTime' - ]; - /** - * The time when the live blog will stop covering the Event. Note that - * coverage may continue after the Event concludes. - * - * @var DateTime [schema.org types: DateTime] - */ - public $coverageEndTime; - /** - * The time when the live blog will begin covering the Event. Note that - * coverage may begin before the Event's start time. The LiveBlogPosting may - * also be created before coverage begins. - * - * @var DateTime [schema.org types: DateTime] - */ - public $coverageStartTime; /** - * An update to the LiveBlog. - * - * @var BlogPosting [schema.org types: BlogPosting] + * @inheritdoc */ - public $liveBlogUpdate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['coverageEndTime', 'coverageStartTime', 'dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['coverageEndTime', 'coverageStartTime', 'liveBlogUpdate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LiveBlogPostingInterface.php b/src/models/jsonld/LiveBlogPostingInterface.php new file mode 100644 index 000000000..5d1dbbc34 --- /dev/null +++ b/src/models/jsonld/LiveBlogPostingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LivingWithHealthAspectInterface.php b/src/models/jsonld/LivingWithHealthAspectInterface.php new file mode 100644 index 000000000..44c50e2fe --- /dev/null +++ b/src/models/jsonld/LivingWithHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'currency' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'gracePeriod' => ['Duration'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'loanRepaymentForm' => ['RepaymentSpecification'], + 'loanTerm' => ['QuantitativeValue'], + 'loanType' => ['URL', 'Text'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'recourseLoan' => ['Boolean'], + 'renegotiableLoan' => ['Boolean'], + 'requiredCollateral' => ['Text', 'Thing'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amount', - 'currency', - 'gracePeriod', - 'loanRepaymentForm', - 'loanTerm', - 'loanType', - 'recourseLoan', - 'renegotiableLoan', - 'requiredCollateral' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amount' => ['MonetaryAmount', 'Number'], - 'currency' => ['Text'], - 'gracePeriod' => ['Duration'], - 'loanRepaymentForm' => ['RepaymentSpecification'], - 'loanTerm' => ['QuantitativeValue'], - 'loanType' => ['Text', 'URL'], - 'recourseLoan' => ['Boolean'], - 'renegotiableLoan' => ['Boolean'], - 'requiredCollateral' => ['Text', 'Thing'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amount' => 'The amount of money.', - 'currency' => 'The currency in which the monetary amount is expressed. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'gracePeriod' => 'The period of time after any due date that the borrower has to fulfil its obligations before a default (failure to pay) is deemed to have occurred.', - 'loanRepaymentForm' => 'A form of paying back money previously borrowed from a lender. Repayment usually takes the form of periodic payments that normally include part principal plus interest in each payment.', - 'loanTerm' => 'The duration of the loan or credit agreement.', - 'loanType' => 'The type of a loan or credit.', - 'recourseLoan' => 'The only way you get the money back in the event of default is the security. Recourse is where you still have the opportunity to go back to the borrower for the rest of the money.', - 'renegotiableLoan' => 'Whether the terms for payment of interest can be renegotiated during the life of the loan.', - 'requiredCollateral' => 'Assets required to secure loan or credit repayments. It may take form of third party pledge, goods, financial instruments (cash, securities, etc.)' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The amount of money. - * - * @var mixed|MonetaryAmount|float [schema.org types: MonetaryAmount, Number] - */ - public $amount; - /** - * The currency in which the monetary amount is expressed. Use standard - * formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for - * cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings - * Systems (LETS) and other currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currency; - /** - * The period of time after any due date that the borrower has to fulfil its - * obligations before a default (failure to pay) is deemed to have occurred. - * - * @var Duration [schema.org types: Duration] - */ - public $gracePeriod; - /** - * A form of paying back money previously borrowed from a lender. Repayment - * usually takes the form of periodic payments that normally include part - * principal plus interest in each payment. - * - * @var RepaymentSpecification [schema.org types: RepaymentSpecification] + * @inheritdoc */ - public $loanRepaymentForm; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'currency' => 'The currency in which the monetary amount is expressed. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'gracePeriod' => 'The period of time after any due date that the borrower has to fulfil its obligations before a default (failure to pay) is deemed to have occurred.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'loanRepaymentForm' => 'A form of paying back money previously borrowed from a lender. Repayment usually takes the form of periodic payments that normally include part principal plus interest in each payment.', + 'loanTerm' => 'The duration of the loan or credit agreement.', + 'loanType' => 'The type of a loan or credit.', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'recourseLoan' => 'The only way you get the money back in the event of default is the security. Recourse is where you still have the opportunity to go back to the borrower for the rest of the money.', + 'renegotiableLoan' => 'Whether the terms for payment of interest can be renegotiated during the life of the loan.', + 'requiredCollateral' => 'Assets required to secure loan or credit repayments. It may take form of third party pledge, goods, financial instruments (cash, securities, etc.)', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The duration of the loan or credit agreement. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $loanTerm; - /** - * The type of a loan or credit. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $loanType; - /** - * The only way you get the money back in the event of default is the - * security. Recourse is where you still have the opportunity to go back to - * the borrower for the rest of the money. - * - * @var bool [schema.org types: Boolean] - */ - public $recourseLoan; - /** - * Whether the terms for payment of interest can be renegotiated during the - * life of the loan. - * - * @var bool [schema.org types: Boolean] - */ - public $renegotiableLoan; - /** - * Assets required to secure loan or credit repayments. It may take form of - * third party pledge, goods, financial instruments (cash, securities, etc.) - * - * @var mixed|string|Thing [schema.org types: Text, Thing] + * @inheritdoc */ - public $requiredCollateral; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amount', 'currency', 'gracePeriod', 'loanRepaymentForm', 'loanTerm', 'loanType', 'recourseLoan', 'renegotiableLoan', 'requiredCollateral'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LoanOrCreditInterface.php b/src/models/jsonld/LoanOrCreditInterface.php new file mode 100644 index 000000000..4b58df3a6 --- /dev/null +++ b/src/models/jsonld/LoanOrCreditInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } - // Public Properties from Self - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - // Properties from Self - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange', - // Properties from Place - 'additionalProperty', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'geo', - 'hasMap', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - // Properties from Self - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'], - // Properties from Place - 'additionalProperty' => ['PropertyValue'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'hasMap' => ['Map', 'URL'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - // Properties from Self - 'currenciesAccepted' => 'The currency accepted (in ISO 4217 currency format).', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, credit card, etc.', - 'priceRange' => 'The price range of the business, for example $$$.', - // Properties from Place - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'geo' => 'The geo coordinates of the place.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties from Place - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted (in ISO 4217 currency format). - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, credit card, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; - /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] - */ - public $priceRange; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var mixed|string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var mixed|Place [schema.org types: Place] - */ - public $containedInPlace; /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var mixed|Place [schema.org types: Place] - */ - public $containsPlace; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * The total number of individuals that may attend an event or venue. - * - * @var mixed|int [schema.org types: Integer] + * @inheritdoc */ - public $maximumAttendeeCapacity; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The opening hours of a certain place. - * - * @var mixed|OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var mixed|bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var mixed|bool [schema.org types: Boolean] - */ - public $smokingAllowed; /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var mixed|OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] + * @inheritdoc */ - public $specialOpeningHoursSpecification; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - // Properties from Self - [['currenciesAccepted', 'openingHours', 'openingHoursSpecification', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - // Properties from Place - [['additionalProperty', 'branchCode', 'containedInPlace', 'containsPlace', 'geo', 'hasMap', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'smokingAllowed', 'specialOpeningHoursSpecification'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LocalBusinessInterface.php b/src/models/jsonld/LocalBusinessInterface.php new file mode 100644 index 000000000..968500473 --- /dev/null +++ b/src/models/jsonld/LocalBusinessInterface.php @@ -0,0 +1,24 @@ +. * If a business is + * open 7 days a week, then it can be specified as . + * + * @var string|Text + */ + public $openingHours; + + /** + * The price range of the business, for example ```$$$```. + * + * @var string|Text + */ + public $priceRange; + + /** + * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. + * + * @var string|Text + */ + public $paymentAccepted; + + /** + * The currency accepted. 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 Tradings + * Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) + * (LETS) and other currency types e.g. "Ithaca HOUR". + * + * @var string|Text + */ + public $currenciesAccepted; + +} diff --git a/src/models/jsonld/LocationFeatureSpecification.php b/src/models/jsonld/LocationFeatureSpecification.php index f3f9d9743..2f6c8d3b6 100644 --- a/src/models/jsonld/LocationFeatureSpecification.php +++ b/src/models/jsonld/LocationFeatureSpecification.php @@ -1,29 +1,29 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxValue' => ['Number'], + 'measurementTechnique' => ['Text', 'URL'], + 'minValue' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'propertyID' => ['Text', 'URL'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'unitCode' => ['Text', 'URL'], + 'unitText' => ['Text'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'value' => ['Text', 'Number', 'StructuredValue', 'Boolean'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'hoursAvailable', - 'validFrom', - 'validThrough' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hoursAvailable' => ['OpeningHoursSpecification'], - 'validFrom' => ['Date', 'DateTime'], - 'validThrough' => ['Date', 'DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'hoursAvailable' => 'The hours during which this service or contact is available.', - 'validFrom' => 'The date when the item becomes valid.', - 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maxValue' => 'The upper value of some characteristic or property.', + 'measurementTechnique' => 'A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]), corresponding to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]]). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if [[variableMeasured]] is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the [[variableMeasured]] is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several [[variableMeasured]] properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]]. ', + 'minValue' => 'The lower value of some characteristic or property.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'propertyID' => 'A commonly used identifier for the characteristic represented by the property, e.g. a manufacturer or a standard code for a property. propertyID can be (1) a prefixed string, mainly meant to be used with standards for product properties; (2) a site-specific, non-prefixed string (e.g. the primary key of the property or the vendor-specific id of the property), or (3) a URL indicating the type of the property, either pointing to an external vocabulary, or a Web resource that describes the property (e.g. a glossary entry). Standards bodies should promote a standard prefix for the identifiers of properties from their standards.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'unitCode' => 'The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.', + 'unitText' => 'A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'value' => 'The value of the quantitative value or property value node. * For [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type for values is \'Number\'. * For [[PropertyValue]], it can be \'Text;\', \'Number\', \'Boolean\', or \'StructuredValue\'. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The hours during which this service or contact is available. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $hoursAvailable; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; /** - * The date after when the item is not valid. For example the end of an offer, - * salary period, or a period of opening hours. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $validThrough; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hoursAvailable', 'validFrom', 'validThrough'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LocationFeatureSpecificationInterface.php b/src/models/jsonld/LocationFeatureSpecificationInterface.php new file mode 100644 index 000000000..ccc8720e5 --- /dev/null +++ b/src/models/jsonld/LocationFeatureSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LockerDeliveryInterface.php b/src/models/jsonld/LockerDeliveryInterface.php new file mode 100644 index 000000000..ed6039c90 --- /dev/null +++ b/src/models/jsonld/LockerDeliveryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LocksmithInterface.php b/src/models/jsonld/LocksmithInterface.php new file mode 100644 index 000000000..f82c7fa76 --- /dev/null +++ b/src/models/jsonld/LocksmithInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableLanguage' => ['Text', 'Language'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'checkinTime' => ['DateTime', 'Time'], + 'checkoutTime' => ['DateTime', 'Time'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amenityFeature', - 'audience', - 'availableLanguage', - 'checkinTime', - 'checkoutTime', - 'numberOfRooms', - 'petsAllowed', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amenityFeature' => ['LocationFeatureSpecification'], - 'audience' => ['Audience'], - 'availableLanguage' => ['Language', 'Text'], - 'checkinTime' => ['DateTime', 'Time'], - 'checkoutTime' => ['DateTime', 'Time'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'petsAllowed' => ['Boolean', 'Text'], - 'starRating' => ['Rating'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. See also inLanguage', - 'checkinTime' => 'The earliest someone may check into a lodging establishment.', - 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A language someone may use with or at the item, service or place. Please - * use one of the language codes from the IETF BCP 47 standard. See also - * inLanguage - * - * @var mixed|Language|string [schema.org types: Language, Text] + * @inheritdoc */ - public $availableLanguage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'checkinTime' => 'The earliest someone may check into a lodging establishment.', + 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The earliest someone may check into a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkinTime; - /** - * The latest someone may check out of a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkoutTime; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; - /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amenityFeature', 'audience', 'availableLanguage', 'checkinTime', 'checkoutTime', 'numberOfRooms', 'petsAllowed', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LodgingBusinessInterface.php b/src/models/jsonld/LodgingBusinessInterface.php new file mode 100644 index 000000000..cfcf27a8c --- /dev/null +++ b/src/models/jsonld/LodgingBusinessInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'checkinTime' => ['DateTime', 'Time'], + 'checkoutTime' => ['DateTime', 'Time'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lodgingUnitDescription' => ['Text'], + 'lodgingUnitType' => ['QualitativeValue', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'numAdults' => ['Integer', 'QuantitativeValue'], + 'numChildren' => ['Integer', 'QuantitativeValue'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'checkinTime', - 'checkoutTime', - 'lodgingUnitDescription', - 'lodgingUnitType', - 'numAdults', - 'numChildren' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'checkinTime' => ['DateTime', 'Time'], - 'checkoutTime' => ['DateTime', 'Time'], - 'lodgingUnitDescription' => ['Text'], - 'lodgingUnitType' => ['QualitativeValue', 'Text'], - 'numAdults' => ['Integer', 'QuantitativeValue'], - 'numChildren' => ['Integer', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'checkinTime' => 'The earliest someone may check into a lodging establishment.', - 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', - 'lodgingUnitDescription' => 'A full description of the lodging unit.', - 'lodgingUnitType' => 'Textual description of the unit type (including suite vs. room, size of bed, etc.).', - 'numAdults' => 'The number of adults staying in the unit.', - 'numChildren' => 'The number of children staying in the unit.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The earliest someone may check into a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] + * @inheritdoc */ - public $checkinTime; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'checkinTime' => 'The earliest someone may check into a lodging establishment.', + 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lodgingUnitDescription' => 'A full description of the lodging unit.', + 'lodgingUnitType' => 'Textual description of the unit type (including suite vs. room, size of bed, etc.).', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'numAdults' => 'The number of adults staying in the unit.', + 'numChildren' => 'The number of children staying in the unit.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The latest someone may check out of a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkoutTime; /** - * A full description of the lodging unit. - * - * @var string [schema.org types: Text] - */ - public $lodgingUnitDescription; - /** - * Textual description of the unit type (including suite vs. room, size of - * bed, etc.). - * - * @var mixed|QualitativeValue|string [schema.org types: QualitativeValue, Text] - */ - public $lodgingUnitType; - /** - * The number of adults staying in the unit. - * - * @var mixed|int|QuantitativeValue [schema.org types: Integer, QuantitativeValue] - */ - public $numAdults; - /** - * The number of children staying in the unit. - * - * @var mixed|int|QuantitativeValue [schema.org types: Integer, QuantitativeValue] + * @inheritdoc */ - public $numChildren; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['checkinTime', 'checkoutTime', 'lodgingUnitDescription', 'lodgingUnitType', 'numAdults', 'numChildren'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LodgingReservationInterface.php b/src/models/jsonld/LodgingReservationInterface.php new file mode 100644 index 000000000..8320082cb --- /dev/null +++ b/src/models/jsonld/LodgingReservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LongitudinalInterface.php b/src/models/jsonld/LongitudinalInterface.php new file mode 100644 index 000000000..12fd3c483 --- /dev/null +++ b/src/models/jsonld/LongitudinalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'], + 'winner' => ['Person'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'winner' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.', + 'winner' => 'A sub property of participant. The winner of the action.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'winner' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'winner' => 'A sub property of participant. The winner of the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The winner of the action. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $winner; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['winner'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LoseActionInterface.php b/src/models/jsonld/LoseActionInterface.php new file mode 100644 index 000000000..c267f37c9 --- /dev/null +++ b/src/models/jsonld/LoseActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LowCalorieDietInterface.php b/src/models/jsonld/LowCalorieDietInterface.php new file mode 100644 index 000000000..1a598ba7a --- /dev/null +++ b/src/models/jsonld/LowCalorieDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LowFatDietInterface.php b/src/models/jsonld/LowFatDietInterface.php new file mode 100644 index 000000000..f34cf5ef3 --- /dev/null +++ b/src/models/jsonld/LowFatDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LowLactoseDietInterface.php b/src/models/jsonld/LowLactoseDietInterface.php new file mode 100644 index 000000000..0cfa6010c --- /dev/null +++ b/src/models/jsonld/LowLactoseDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LowSaltDietInterface.php b/src/models/jsonld/LowSaltDietInterface.php new file mode 100644 index 000000000..7f487eaa9 --- /dev/null +++ b/src/models/jsonld/LowSaltDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LungInterface.php b/src/models/jsonld/LungInterface.php new file mode 100644 index 000000000..805689677 --- /dev/null +++ b/src/models/jsonld/LungInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'originatesFrom' => ['Vessel'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'regionDrained' => ['AnatomicalSystem', 'AnatomicalStructure'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'runsTo' => ['Vessel'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'originatesFrom', - 'regionDrained', - 'runsTo' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'originatesFrom' => ['Vessel'], - 'regionDrained' => ['AnatomicalStructure', 'AnatomicalSystem'], - 'runsTo' => ['Vessel'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'originatesFrom' => 'The vasculature the lymphatic structure originates, or afferents, from.', - 'regionDrained' => 'The anatomical or organ system drained by this vessel; generally refers to a specific part of an organ.', - 'runsTo' => 'The vasculature the lymphatic structure runs, or efferents, to.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'originatesFrom' => 'The vasculature the lymphatic structure originates, or afferents, from.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'regionDrained' => 'The anatomical or organ system drained by this vessel; generally refers to a specific part of an organ.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'runsTo' => 'The vasculature the lymphatic structure runs, or efferents, to.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The vasculature the lymphatic structure originates, or afferents, from. - * - * @var Vessel [schema.org types: Vessel] - */ - public $originatesFrom; - /** - * The anatomical or organ system drained by this vessel; generally refers to - * a specific part of an organ. - * - * @var mixed|AnatomicalStructure|AnatomicalSystem [schema.org types: AnatomicalStructure, AnatomicalSystem] - */ - public $regionDrained; /** - * The vasculature the lymphatic structure runs, or efferents, to. - * - * @var Vessel [schema.org types: Vessel] + * @inheritdoc */ - public $runsTo; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['originatesFrom', 'regionDrained', 'runsTo'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/LymphaticVesselInterface.php b/src/models/jsonld/LymphaticVesselInterface.php new file mode 100644 index 000000000..d0ee7ab63 --- /dev/null +++ b/src/models/jsonld/LymphaticVesselInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MRIInterface.php b/src/models/jsonld/MRIInterface.php new file mode 100644 index 000000000..c317c5a19 --- /dev/null +++ b/src/models/jsonld/MRIInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/MSRPInterface.php b/src/models/jsonld/MSRPInterface.php new file mode 100644 index 000000000..f9dd2296e --- /dev/null +++ b/src/models/jsonld/MSRPInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MaleInterface.php b/src/models/jsonld/MaleInterface.php new file mode 100644 index 000000000..bb335425c --- /dev/null +++ b/src/models/jsonld/MaleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. The number of interactions for the CreativeWork using the - * WebSite or SoftwareApplication. The most specific child type of - * InteractionCounter should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ManuscriptInterface.php b/src/models/jsonld/ManuscriptInterface.php new file mode 100644 index 000000000..8f17643fd --- /dev/null +++ b/src/models/jsonld/ManuscriptInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'mapType' => ['MapCategoryType'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'mapType' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'mapType' => 'Indicates the kind of Map, from the MapCategoryType Enumeration.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'mapType' => ['MapCategoryType'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'mapType' => 'Indicates the kind of Map, from the MapCategoryType Enumeration.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the kind of Map, from the MapCategoryType Enumeration. - * - * @var MapCategoryType [schema.org types: MapCategoryType] + * @inheritdoc */ - public $mapType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['mapType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MapCategoryType.php b/src/models/jsonld/MapCategoryType.php index 42eae80f5..bd7444132 100644 --- a/src/models/jsonld/MapCategoryType.php +++ b/src/models/jsonld/MapCategoryType.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MapCategoryTypeInterface.php b/src/models/jsonld/MapCategoryTypeInterface.php new file mode 100644 index 000000000..488814658 --- /dev/null +++ b/src/models/jsonld/MapCategoryTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MarryActionInterface.php b/src/models/jsonld/MarryActionInterface.php new file mode 100644 index 000000000..75b25e167 --- /dev/null +++ b/src/models/jsonld/MarryActionInterface.php @@ -0,0 +1,24 @@ + '. E.g., '7 kg'. + * schema.org version: v14.0-release + * Mass - Properties that take Mass as values are of the form ' '. E.g., '7 kg'. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Mass + * @see https://schema.org/Mass */ -class Mass extends Quantity +class Mass extends MetaJsonLd implements MassInterface, QuantityInterface, IntangibleInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -32,274 +32,115 @@ class Mass extends Quantity * * @var string */ - static public $schemaTypeName = 'Mass'; + static public string $schemaTypeName = 'Mass'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Mass'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'Properties that take Mass as values are of the form \' \'. E.g., \'7 kg\'.'; + static public string $schemaTypeScope = 'https://schema.org/Mass'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Quantity'; + static public string $schemaTypeExtends = 'Quantity'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = << '. E.g., '7 kg'. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use MassTrait; + use QuantityTrait; + use IntangibleTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MassInterface.php b/src/models/jsonld/MassInterface.php new file mode 100644 index 000000000..bb4aa5b13 --- /dev/null +++ b/src/models/jsonld/MassInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mathExpression' => ['SolveMathAction', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mathExpression' => 'A mathematical expression (e.g. \'x^2-3x=0\') that may be solved for a specific variable, simplified, or transformed. This can take many formats, e.g. LaTeX, Ascii-Math, or math as you would write with a keyboard.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/MathSolverInterface.php b/src/models/jsonld/MathSolverInterface.php new file mode 100644 index 000000000..852ff4f03 --- /dev/null +++ b/src/models/jsonld/MathSolverInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseUnit' => ['Text'], + 'doseValue' => ['Number', 'QualitativeValue'], + 'frequency' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'targetPopulation' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'doseUnit', - 'doseValue', - 'frequency', - 'targetPopulation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'doseUnit' => ['Text'], - 'doseValue' => ['Number', 'QualitativeValue'], - 'frequency' => ['Text'], - 'targetPopulation' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'doseUnit' => 'The unit of the dose, e.g. \'mg\'.', - 'doseValue' => 'The value of the dose, e.g. 500.', - 'frequency' => 'How often the dose is taken, e.g. \'daily\'.', - 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'doseUnit' => 'The unit of the dose, e.g. \'mg\'.', + 'doseValue' => 'The value of the dose, e.g. 500.', + 'frequency' => 'How often the dose is taken, e.g. \'daily\'.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The unit of the dose, e.g. 'mg'. - * - * @var string [schema.org types: Text] - */ - public $doseUnit; - /** - * The value of the dose, e.g. 500. - * - * @var mixed|float|QualitativeValue [schema.org types: Number, QualitativeValue] - */ - public $doseValue; - /** - * How often the dose is taken, e.g. 'daily'. - * - * @var string [schema.org types: Text] - */ - public $frequency; /** - * Characteristics of the population for which this is intended, or which - * typically uses it, e.g. 'adults'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $targetPopulation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['doseUnit', 'doseValue', 'frequency', 'targetPopulation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MaximumDoseScheduleInterface.php b/src/models/jsonld/MaximumDoseScheduleInterface.php new file mode 100644 index 000000000..aa108ab1e --- /dev/null +++ b/src/models/jsonld/MaximumDoseScheduleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MayTreatHealthAspectInterface.php b/src/models/jsonld/MayTreatHealthAspectInterface.php new file mode 100644 index 000000000..37c11fcfe --- /dev/null +++ b/src/models/jsonld/MayTreatHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/MeasurementTypeEnumerationInterface.php b/src/models/jsonld/MeasurementTypeEnumerationInterface.php new file mode 100644 index 000000000..794d15fc4 --- /dev/null +++ b/src/models/jsonld/MeasurementTypeEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MediaGalleryInterface.php b/src/models/jsonld/MediaGalleryInterface.php new file mode 100644 index 000000000..7d5c4901b --- /dev/null +++ b/src/models/jsonld/MediaGalleryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MediaManipulationRatingEnumerationInterface.php b/src/models/jsonld/MediaManipulationRatingEnumerationInterface.php new file mode 100644 index 000000000..c6e340187 --- /dev/null +++ b/src/models/jsonld/MediaManipulationRatingEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedArticle', - 'bitrate', - 'contentSize', - 'contentUrl', - 'duration', - 'embedUrl', - 'encodesCreativeWork', - 'encodingFormat', - 'endTime', - 'height', - 'playerType', - 'productionCompany', - 'regionsAllowed', - 'requiresSubscription', - 'startTime', - 'uploadDate', - 'width' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedArticle' => ['NewsArticle'], - 'bitrate' => ['Text'], - 'contentSize' => ['Text'], - 'contentUrl' => ['URL'], - 'duration' => ['Duration'], - 'embedUrl' => ['URL'], - 'encodesCreativeWork' => ['CreativeWork'], - 'encodingFormat' => ['Text', 'URL'], - 'endTime' => ['DateTime', 'Time'], - 'height' => ['Distance', 'QuantitativeValue'], - 'playerType' => ['Text'], - 'productionCompany' => ['Organization'], - 'regionsAllowed' => ['Place'], - 'requiresSubscription' => ['Boolean', 'MediaSubscription'], - 'startTime' => ['DateTime', 'Time'], - 'uploadDate' => ['Date'], - 'width' => ['Distance', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedArticle' => 'A NewsArticle associated with the Media Object.', - 'bitrate' => 'The bitrate of the media object.', - 'contentSize' => 'File size in (mega/kilo) bytes.', - 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the src element of an embed tag and should not be the same as the content of the loc tag.', - 'encodesCreativeWork' => 'The CreativeWork encoded by this media object. Inverse property: encoding.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'height' => 'The height of the item.', - 'playerType' => 'Player type required—for example, Flash or Silverlight.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in ISO 3166 format.', - 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are true or false (note that an earlier version had \'yes\', \'no\').', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'uploadDate' => 'Date when this media object was uploaded to this site.', - 'width' => 'The width of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A NewsArticle associated with the Media Object. - * - * @var NewsArticle [schema.org types: NewsArticle] - */ - public $associatedArticle; - /** - * The bitrate of the media object. - * - * @var string [schema.org types: Text] - */ - public $bitrate; - /** - * File size in (mega/kilo) bytes. - * - * @var string [schema.org types: Text] - */ - public $contentSize; - /** - * Actual bytes of the media object, for example the image file or video file. - * - * @var string [schema.org types: URL] - */ - public $contentUrl; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * A URL pointing to a player for a specific video. In general, this is the - * information in the src element of an embed tag and should not be the same - * as the content of the loc tag. - * - * @var string [schema.org types: URL] - */ - public $embedUrl; - /** - * The CreativeWork encoded by this media object. Inverse property: encoding. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $encodesCreativeWork; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * The height of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] - */ - public $height; - /** - * Player type required—for example, Flash or Silverlight. - * - * @var string [schema.org types: Text] - */ - public $playerType; - /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] + * @inheritdoc */ - public $productionCompany; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The regions where the media is allowed. If not specified, then it's assumed - * to be allowed everywhere. Specify the countries in ISO 3166 format. - * - * @var Place [schema.org types: Place] - */ - public $regionsAllowed; - /** - * Indicates if use of the media require a subscription (either paid or free). - * Allowed values are true or false (note that an earlier version had 'yes', - * 'no'). - * - * @var mixed|bool|MediaSubscription [schema.org types: Boolean, MediaSubscription] - */ - public $requiresSubscription; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; - /** - * Date when this media object was uploaded to this site. - * - * @var Date [schema.org types: Date] - */ - public $uploadDate; /** - * The width of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] + * @inheritdoc */ - public $width; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedArticle', 'bitrate', 'contentSize', 'contentUrl', 'duration', 'embedUrl', 'encodesCreativeWork', 'encodingFormat', 'endTime', 'height', 'playerType', 'productionCompany', 'regionsAllowed', 'requiresSubscription', 'startTime', 'uploadDate', 'width'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MediaObjectInterface.php b/src/models/jsonld/MediaObjectInterface.php new file mode 100644 index 000000000..49620c8ad --- /dev/null +++ b/src/models/jsonld/MediaObjectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedClaimReview' => ['Review'], + 'associatedMedia' => ['MediaObject'], + 'associatedMediaReview' => ['Review'], + 'associatedReview' => ['Review'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'itemReviewed' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mediaAuthenticityCategory' => ['MediaManipulationRatingEnumeration'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'negativeNotes' => ['ListItem', 'Text', 'WebContent', 'ItemList'], + 'offers' => ['Offer', 'Demand'], + 'originalMediaContextDescription' => ['Text'], + 'originalMediaLink' => ['URL', 'MediaObject', 'WebPage'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'positiveNotes' => ['WebContent', 'Text', 'ListItem', 'ItemList'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewAspect' => ['Text'], + 'reviewBody' => ['Text'], + 'reviewRating' => ['Rating'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'mediaAuthenticityCategory' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedClaimReview' => 'An associated [[ClaimReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'associatedMediaReview' => 'An associated [[MediaReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedReview' => 'An associated [[Review]].', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mediaAuthenticityCategory' => 'Indicates a MediaManipulationRatingEnumeration classification of a media object (in the context of how it was published or shared).', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'negativeNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), negative considerations - either as unstructured text, or a list.', + '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. ', + 'originalMediaContextDescription' => 'Describes, in a [[MediaReview]] when dealing with [[DecontextualizedContent]], background information that can contribute to better interpretation of the [[MediaObject]].', + 'originalMediaLink' => 'Link to the page containing an original version of the content, or directly to an online copy of the original [[MediaObject]] content, e.g. video file.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'positiveNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), positive considerations - either as unstructured text, or a list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewBody' => 'The actual body of the review.', + 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating``` applies to rating given by the review. The [[aggregateRating]] property applies to the review itself, as a creative work.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'mediaAuthenticityCategory' => ['MediaManipulationRatingEnumeration'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'mediaAuthenticityCategory' => 'Indicates a MediaManipulationRatingEnumeration classification of a media object (in the context of how it was published or shared).' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates a MediaManipulationRatingEnumeration classification of a media - * object (in the context of how it was published or shared). - * - * @var MediaManipulationRatingEnumeration [schema.org types: MediaManipulationRatingEnumeration] + * @inheritdoc */ - public $mediaAuthenticityCategory; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['mediaAuthenticityCategory'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MediaReviewInterface.php b/src/models/jsonld/MediaReviewInterface.php new file mode 100644 index 000000000..5d601eff3 --- /dev/null +++ b/src/models/jsonld/MediaReviewInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mediaItemAppearance' => ['MediaObject'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mediaItemAppearance' => 'In the context of a [[MediaReview]], indicates specific media item(s) that are grouped using a [[MediaReviewItem]].', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/MediaReviewItemInterface.php b/src/models/jsonld/MediaReviewItemInterface.php new file mode 100644 index 000000000..0e9f74272 --- /dev/null +++ b/src/models/jsonld/MediaReviewItemInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'authenticator' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'authenticator', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'authenticator' => ['Organization'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'authenticator' => 'The Organization responsible for authenticating the user\'s subscription. For example, many media apps require a cable/satellite provider to authenticate your subscription before playing media.', + 'description' => 'A description of the item.', + '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.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'authenticator' => 'The Organization responsible for authenticating the user\'s subscription. For example, many media apps require a cable/satellite provider to authenticate your subscription before playing media.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The Organization responsible for authenticating the user's subscription. - * For example, many media apps require a cable/satellite provider to - * authenticate your subscription before playing media. - * - * @var Organization [schema.org types: Organization] - */ - public $authenticator; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['authenticator', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MediaSubscriptionInterface.php b/src/models/jsonld/MediaSubscriptionInterface.php new file mode 100644 index 000000000..15c8bbbab --- /dev/null +++ b/src/models/jsonld/MediaSubscriptionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'audienceType' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'geographicArea' => ['AdministrativeArea'], + 'healthCondition' => ['MedicalCondition'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'requiredGender' => ['Text'], + 'requiredMaxAge' => ['Integer'], + 'requiredMinAge' => ['Integer'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'suggestedAge' => ['QuantitativeValue'], + 'suggestedGender' => ['GenderType', 'Text'], + 'suggestedMaxAge' => ['Number'], + 'suggestedMeasurement' => ['QuantitativeValue'], + 'suggestedMinAge' => ['Number'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'audienceType' => 'The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).', + 'description' => 'A description of the item.', + '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.', + 'geographicArea' => 'The geographic area associated with the audience.', + 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'requiredGender' => 'Audiences defined by a person\'s gender.', + 'requiredMaxAge' => 'Audiences defined by a person\'s maximum age.', + 'requiredMinAge' => 'Audiences defined by a person\'s minimum age.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'suggestedAge' => 'The age or age range for the intended audience or person, for example 3-12 months for infants, 1-5 years for toddlers.', + 'suggestedGender' => 'The suggested gender of the intended person or audience, for example "male", "female", or "unisex".', + 'suggestedMaxAge' => 'Maximum recommended age in years for the audience or user.', + 'suggestedMeasurement' => 'A suggested range of body measurements for the intended audience or person, for example inseam between 32 and 34 inches or height between 170 and 190 cm. Typically found on a size chart for wearable products.', + 'suggestedMinAge' => 'Minimum recommended age in years for the audience or user.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalAudienceInterface.php b/src/models/jsonld/MedicalAudienceInterface.php new file mode 100644 index 000000000..356d81fa4 --- /dev/null +++ b/src/models/jsonld/MedicalAudienceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/MedicalAudienceTypeInterface.php b/src/models/jsonld/MedicalAudienceTypeInterface.php new file mode 100644 index 000000000..67838809b --- /dev/null +++ b/src/models/jsonld/MedicalAudienceTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } - // Public Properties from Self - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange', - 'healthPlanNetworkId', - 'isAcceptingNewPatients', - 'medicalSpecialty' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'], - 'healthPlanNetworkId' => ['Text'], - 'isAcceptingNewPatients' => ['Boolean'], - 'medicalSpecialty' => ['MedicalSpecialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.', - 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', - 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', - 'medicalSpecialty' => 'A medical specialty of the provider.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties from MedicalOrganization - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; - /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] - */ - public $priceRange; - /** - * Name or unique ID of network. (Networks are often reused across different - * insurance plans). - * - * @var string [schema.org types: Text] - */ - public $healthPlanNetworkId; - /** - * Whether the provider is accepting new patients. - * - * @var bool [schema.org types: Boolean] - */ - public $isAcceptingNewPatients; - /** - * A medical specialty of the provider. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] + * @inheritdoc */ - public $medicalSpecialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [['healthPlanNetworkId', 'isAcceptingNewPatients', 'medicalSpecialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalBusinessInterface.php b/src/models/jsonld/MedicalBusinessInterface.php new file mode 100644 index 000000000..b57b8337c --- /dev/null +++ b/src/models/jsonld/MedicalBusinessInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'causeOf' => ['MedicalEntity'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'causeOf' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'causeOf' => 'The condition, complication, symptom, sign, etc. caused.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'causeOf' => ['MedicalEntity'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'causeOf' => 'The condition, complication, symptom, sign, etc. caused.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The condition, complication, symptom, sign, etc. caused. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $causeOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['causeOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalCauseInterface.php b/src/models/jsonld/MedicalCauseInterface.php new file mode 100644 index 000000000..b8afe1113 --- /dev/null +++ b/src/models/jsonld/MedicalCauseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availableService' => ['MedicalTest', 'MedicalProcedure', 'MedicalTherapy'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthPlanNetworkId' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAcceptingNewPatients' => ['Boolean'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'medicalSpecialty' => ['MedicalSpecialty'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'availableService', - 'medicalSpecialty' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'availableService' => ['MedicalProcedure', 'MedicalTest', 'MedicalTherapy'], - 'medicalSpecialty' => ['MedicalSpecialty'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availableService' => 'A medical service available from this provider.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'medicalSpecialty' => 'A medical specialty of the provider.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'availableService' => 'A medical service available from this provider.', - 'medicalSpecialty' => 'A medical specialty of the provider.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical service available from this provider. - * - * @var mixed|MedicalProcedure|MedicalTest|MedicalTherapy [schema.org types: MedicalProcedure, MedicalTest, MedicalTherapy] - */ - public $availableService; - /** - * A medical specialty of the provider. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] + * @inheritdoc */ - public $medicalSpecialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['availableService', 'medicalSpecialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalClinicInterface.php b/src/models/jsonld/MedicalClinicInterface.php new file mode 100644 index 000000000..3d6279c86 --- /dev/null +++ b/src/models/jsonld/MedicalClinicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'codeValue' => ['Text'], + 'codingSystem' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inCodeSet' => ['CategoryCodeSet', 'URL'], + 'inDefinedTermSet' => ['URL', 'DefinedTermSet'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termCode' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'codeValue', - 'codingSystem' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'codeValue' => ['Text'], - 'codingSystem' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'codeValue' => 'A short textual code that uniquely identifies the value.', + 'codingSystem' => 'The coding system, e.g. \'ICD-10\'.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inCodeSet' => 'A [[CategoryCodeSet]] that contains this category code.', + 'inDefinedTermSet' => 'A [[DefinedTermSet]] that contains this term.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termCode' => 'A code that identifies this [[DefinedTerm]] within a [[DefinedTermSet]]', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'codeValue' => 'A short textual code that uniquely identifies the value.', - 'codingSystem' => 'The coding system, e.g. \'ICD-10\'.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A short textual code that uniquely identifies the value. - * - * @var string [schema.org types: Text] - */ - public $codeValue; - /** - * The coding system, e.g. 'ICD-10'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $codingSystem; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['codeValue', 'codingSystem'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalCodeInterface.php b/src/models/jsonld/MedicalCodeInterface.php new file mode 100644 index 000000000..1921a883c --- /dev/null +++ b/src/models/jsonld/MedicalCodeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'differentialDiagnosis' => ['DDxElement'], + 'disambiguatingDescription' => ['Text'], + 'drug' => ['Drug'], + 'epidemiology' => ['Text'], + 'expectedPrognosis' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'naturalProgression' => ['Text'], + 'pathophysiology' => ['Text'], + 'possibleComplication' => ['Text'], + 'possibleTreatment' => ['MedicalTherapy'], + 'potentialAction' => ['Action'], + 'primaryPrevention' => ['MedicalTherapy'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'riskFactor' => ['MedicalRiskFactor'], + 'sameAs' => ['URL'], + 'secondaryPrevention' => ['MedicalTherapy'], + 'signOrSymptom' => ['MedicalSignOrSymptom'], + 'stage' => ['MedicalConditionStage'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'typicalTest' => ['MedicalTest'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedAnatomy', - 'differentialDiagnosis', - 'drug', - 'epidemiology', - 'expectedPrognosis', - 'naturalProgression', - 'pathophysiology', - 'possibleComplication', - 'possibleTreatment', - 'primaryPrevention', - 'riskFactor', - 'secondaryPrevention', - 'signOrSymptom', - 'stage', - 'status', - 'typicalTest' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], - 'differentialDiagnosis' => ['DDxElement'], - 'drug' => ['Drug'], - 'epidemiology' => ['Text'], - 'expectedPrognosis' => ['Text'], - 'naturalProgression' => ['Text'], - 'pathophysiology' => ['Text'], - 'possibleComplication' => ['Text'], - 'possibleTreatment' => ['MedicalTherapy'], - 'primaryPrevention' => ['MedicalTherapy'], - 'riskFactor' => ['MedicalRiskFactor'], - 'secondaryPrevention' => ['MedicalTherapy'], - 'signOrSymptom' => ['MedicalSignOrSymptom'], - 'stage' => ['MedicalConditionStage'], - 'status' => ['EventStatusType', 'MedicalStudyStatus', 'Text'], - 'typicalTest' => ['MedicalTest'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', - 'differentialDiagnosis' => 'One of a set of differential diagnoses for the condition. Specifically, a closely-related or competing diagnosis typically considered later in the cognitive process whereby this medical condition is distinguished from others most likely responsible for a similar collection of signs and symptoms to reach the most parsimonious diagnosis or diagnoses in a patient.', - 'drug' => 'Specifying a drug or medicine used in a medication procedure', - 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', - 'expectedPrognosis' => 'The likely outcome in either the short term or long term of the medical condition.', - 'naturalProgression' => 'The expected progression of the condition if it is not treated and allowed to progress naturally.', - 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.', - 'possibleComplication' => 'A possible unexpected and unfavorable evolution of a medical condition. Complications may include worsening of the signs or symptoms of the disease, extension of the condition to other organ systems, etc.', - 'possibleTreatment' => 'A possible treatment to address this condition, sign or symptom.', - 'primaryPrevention' => 'A preventative therapy used to prevent an initial occurrence of the medical condition, such as vaccination.', - 'riskFactor' => 'A modifiable or non-modifiable factor that increases the risk of a patient contracting this condition, e.g. age, coexisting condition.', - 'secondaryPrevention' => 'A preventative therapy used to prevent reoccurrence of the medical condition after an initial episode of the condition.', - 'signOrSymptom' => 'A sign or symptom of this condition. Signs are objective or physically observable manifestations of the medical condition while symptoms are the subjective experience of the medical condition.', - 'stage' => 'The stage of the condition, if applicable.', - 'status' => 'The status of the study (enumerated).', - 'typicalTest' => 'A medical test typically performed given this condition.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The anatomy of the underlying organ system or structures associated with - * this entity. - * - * @var mixed|AnatomicalStructure|AnatomicalSystem|SuperficialAnatomy [schema.org types: AnatomicalStructure, AnatomicalSystem, SuperficialAnatomy] - */ - public $associatedAnatomy; - /** - * One of a set of differential diagnoses for the condition. Specifically, a - * closely-related or competing diagnosis typically considered later in the - * cognitive process whereby this medical condition is distinguished from - * others most likely responsible for a similar collection of signs and - * symptoms to reach the most parsimonious diagnosis or diagnoses in a - * patient. - * - * @var DDxElement [schema.org types: DDxElement] - */ - public $differentialDiagnosis; - /** - * Specifying a drug or medicine used in a medication procedure - * - * @var Drug [schema.org types: Drug] - */ - public $drug; /** - * The characteristics of associated patients, such as age, gender, race etc. - * - * @var string [schema.org types: Text] - */ - public $epidemiology; - /** - * The likely outcome in either the short term or long term of the medical - * condition. - * - * @var string [schema.org types: Text] - */ - public $expectedPrognosis; - /** - * The expected progression of the condition if it is not treated and allowed - * to progress naturally. - * - * @var string [schema.org types: Text] - */ - public $naturalProgression; - /** - * Changes in the normal mechanical, physical, and biochemical functions that - * are associated with this activity or condition. - * - * @var string [schema.org types: Text] - */ - public $pathophysiology; - /** - * A possible unexpected and unfavorable evolution of a medical condition. - * Complications may include worsening of the signs or symptoms of the - * disease, extension of the condition to other organ systems, etc. - * - * @var string [schema.org types: Text] - */ - public $possibleComplication; - /** - * A possible treatment to address this condition, sign or symptom. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $possibleTreatment; - /** - * A preventative therapy used to prevent an initial occurrence of the medical - * condition, such as vaccination. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $primaryPrevention; - /** - * A modifiable or non-modifiable factor that increases the risk of a patient - * contracting this condition, e.g. age, coexisting condition. - * - * @var MedicalRiskFactor [schema.org types: MedicalRiskFactor] + * @inheritdoc */ - public $riskFactor; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + 'differentialDiagnosis' => 'One of a set of differential diagnoses for the condition. Specifically, a closely-related or competing diagnosis typically considered later in the cognitive process whereby this medical condition is distinguished from others most likely responsible for a similar collection of signs and symptoms to reach the most parsimonious diagnosis or diagnoses in a patient.', + '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.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', + 'expectedPrognosis' => 'The likely outcome in either the short term or long term of the medical condition.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'naturalProgression' => 'The expected progression of the condition if it is not treated and allowed to progress naturally.', + 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.', + 'possibleComplication' => 'A possible unexpected and unfavorable evolution of a medical condition. Complications may include worsening of the signs or symptoms of the disease, extension of the condition to other organ systems, etc.', + 'possibleTreatment' => 'A possible treatment to address this condition, sign or symptom.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryPrevention' => 'A preventative therapy used to prevent an initial occurrence of the medical condition, such as vaccination.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'riskFactor' => 'A modifiable or non-modifiable factor that increases the risk of a patient contracting this condition, e.g. age, coexisting condition.', + '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.', + 'secondaryPrevention' => 'A preventative therapy used to prevent reoccurrence of the medical condition after an initial episode of the condition.', + 'signOrSymptom' => 'A sign or symptom of this condition. Signs are objective or physically observable manifestations of the medical condition while symptoms are the subjective experience of the medical condition.', + 'stage' => 'The stage of the condition, if applicable.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'typicalTest' => 'A medical test typically performed given this condition.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A preventative therapy used to prevent reoccurrence of the medical - * condition after an initial episode of the condition. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $secondaryPrevention; - /** - * A sign or symptom of this condition. Signs are objective or physically - * observable manifestations of the medical condition while symptoms are the - * subjective experience of the medical condition. - * - * @var MedicalSignOrSymptom [schema.org types: MedicalSignOrSymptom] - */ - public $signOrSymptom; - /** - * The stage of the condition, if applicable. - * - * @var MedicalConditionStage [schema.org types: MedicalConditionStage] - */ - public $stage; - /** - * The status of the study (enumerated). - * - * @var mixed|EventStatusType|MedicalStudyStatus|string [schema.org types: EventStatusType, MedicalStudyStatus, Text] - */ - public $status; /** - * A medical test typically performed given this condition. - * - * @var MedicalTest [schema.org types: MedicalTest] + * @inheritdoc */ - public $typicalTest; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedAnatomy', 'differentialDiagnosis', 'drug', 'epidemiology', 'expectedPrognosis', 'naturalProgression', 'pathophysiology', 'possibleComplication', 'possibleTreatment', 'primaryPrevention', 'riskFactor', 'secondaryPrevention', 'signOrSymptom', 'stage', 'status', 'typicalTest'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalConditionInterface.php b/src/models/jsonld/MedicalConditionInterface.php new file mode 100644 index 000000000..eb89dac1f --- /dev/null +++ b/src/models/jsonld/MedicalConditionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'stageAsNumber' => ['Number'], + 'study' => ['MedicalStudy'], + 'subStageSuffix' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'stageAsNumber', - 'subStageSuffix' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'stageAsNumber' => ['Number'], - 'subStageSuffix' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'stageAsNumber' => 'The stage represented as a number, e.g. 3.', + 'study' => 'A medical study or trial related to this entity.', + 'subStageSuffix' => 'The substage, e.g. \'a\' for Stage IIIa.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'stageAsNumber' => 'The stage represented as a number, e.g. 3.', - 'subStageSuffix' => 'The substage, e.g. \'a\' for Stage IIIa.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The stage represented as a number, e.g. 3. - * - * @var float [schema.org types: Number] - */ - public $stageAsNumber; - /** - * The substage, e.g. 'a' for Stage IIIa. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $subStageSuffix; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['stageAsNumber', 'subStageSuffix'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalConditionStageInterface.php b/src/models/jsonld/MedicalConditionStageInterface.php new file mode 100644 index 000000000..375990fa0 --- /dev/null +++ b/src/models/jsonld/MedicalConditionStageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'code', - 'guideline', - 'legalStatus', - 'medicineSystem', - 'recognizingAuthority', - 'relevantSpecialty', - 'study' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'code' => ['MedicalCode'], - 'guideline' => ['MedicalGuideline'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'medicineSystem' => ['MedicineSystem'], - 'recognizingAuthority' => ['Organization'], - 'relevantSpecialty' => ['MedicalSpecialty'], - 'study' => ['MedicalStudy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', - 'guideline' => 'A medical guideline related to this entity.', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', - 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', - 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', - 'study' => 'A medical study or trial related to this entity.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical code for the entity, taken from a controlled vocabulary or - * ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. - * - * @var MedicalCode [schema.org types: MedicalCode] - */ - public $code; - /** - * A medical guideline related to this entity. - * - * @var MedicalGuideline [schema.org types: MedicalGuideline] + * @inheritdoc */ - public $guideline; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The system of medicine that includes this MedicalEntity, for example - * 'evidence-based', 'homeopathic', 'chiropractic', etc. - * - * @var MedicineSystem [schema.org types: MedicineSystem] - */ - public $medicineSystem; - /** - * If applicable, the organization that officially recognizes this entity as - * part of its endorsed system of medicine. - * - * @var Organization [schema.org types: Organization] - */ - public $recognizingAuthority; - /** - * If applicable, a medical specialty in which this entity is relevant. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] - */ - public $relevantSpecialty; /** - * A medical study or trial related to this entity. - * - * @var MedicalStudy [schema.org types: MedicalStudy] + * @inheritdoc */ - public $study; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['code', 'guideline', 'legalStatus', 'medicineSystem', 'recognizingAuthority', 'relevantSpecialty', 'study'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalContraindicationInterface.php b/src/models/jsonld/MedicalContraindicationInterface.php new file mode 100644 index 000000000..ea62fff12 --- /dev/null +++ b/src/models/jsonld/MedicalContraindicationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'adverseOutcome' => ['MedicalEntity'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'contraindication' => ['Text', 'MedicalContraindication'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'postOp' => ['Text'], + 'potentialAction' => ['Action'], + 'preOp' => ['Text'], + 'procedure' => ['Text'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'seriousAdverseOutcome' => ['MedicalEntity'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'adverseOutcome', - 'contraindication', - 'postOp', - 'preOp', - 'procedure', - 'seriousAdverseOutcome' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'adverseOutcome' => ['MedicalEntity'], - 'contraindication' => ['MedicalContraindication', 'Text'], - 'postOp' => ['Text'], - 'preOp' => ['Text'], - 'procedure' => ['Text'], - 'seriousAdverseOutcome' => ['MedicalEntity'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', - 'contraindication' => 'A contraindication for this therapy.', - 'postOp' => 'A description of the postoperative procedures, care, and/or followups for this device.', - 'preOp' => 'A description of the workup, testing, and other preparations required before implanting this device.', - 'procedure' => 'A description of the procedure involved in setting up, using, and/or installing the device.', - 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * A possible complication and/or side effect of this therapy. If it is known - * that an adverse outcome is serious (resulting in death, disability, or - * permanent damage; requiring hospitalization; or is otherwise - * life-threatening or requires immediate medical attention), tag it as a - * seriouseAdverseOutcome instead. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $adverseOutcome; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'contraindication' => 'A contraindication for this therapy.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'postOp' => 'A description of the postoperative procedures, care, and/or followups for this device.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preOp' => 'A description of the workup, testing, and other preparations required before implanting this device.', + 'procedure' => 'A description of the procedure involved in setting up, using, and/or installing the device.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A contraindication for this therapy. - * - * @var mixed|MedicalContraindication|string [schema.org types: MedicalContraindication, Text] - */ - public $contraindication; /** - * A description of the postoperative procedures, care, and/or followups for - * this device. - * - * @var string [schema.org types: Text] - */ - public $postOp; - /** - * A description of the workup, testing, and other preparations required - * before implanting this device. - * - * @var string [schema.org types: Text] - */ - public $preOp; - /** - * A description of the procedure involved in setting up, using, and/or - * installing the device. - * - * @var string [schema.org types: Text] - */ - public $procedure; - /** - * A possible serious complication and/or serious side effect of this therapy. - * Serious adverse outcomes include those that are life-threatening; result in - * death, disability, or permanent damage; require hospitalization or prolong - * existing hospitalization; cause congenital anomalies or birth defects; or - * jeopardize the patient and may require medical or surgical intervention to - * prevent one of the outcomes in this definition. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $seriousAdverseOutcome; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['adverseOutcome', 'contraindication', 'postOp', 'preOp', 'procedure', 'seriousAdverseOutcome'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalDeviceInterface.php b/src/models/jsonld/MedicalDeviceInterface.php new file mode 100644 index 000000000..21bb186a5 --- /dev/null +++ b/src/models/jsonld/MedicalDeviceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalDevicePurposeInterface.php b/src/models/jsonld/MedicalDevicePurposeInterface.php new file mode 100644 index 000000000..7ab11dc7d --- /dev/null +++ b/src/models/jsonld/MedicalDevicePurposeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'code', - 'guideline', - 'legalStatus', - 'medicineSystem', - 'recognizingAuthority', - 'relevantSpecialty', - 'study' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'code' => ['MedicalCode'], - 'guideline' => ['MedicalGuideline'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'medicineSystem' => ['MedicineSystem'], - 'recognizingAuthority' => ['Organization'], - 'relevantSpecialty' => ['MedicalSpecialty'], - 'study' => ['MedicalStudy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', - 'guideline' => 'A medical guideline related to this entity.', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', - 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', - 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', - 'study' => 'A medical study or trial related to this entity.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical code for the entity, taken from a controlled vocabulary or - * ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. - * - * @var MedicalCode [schema.org types: MedicalCode] - */ - public $code; - /** - * A medical guideline related to this entity. - * - * @var MedicalGuideline [schema.org types: MedicalGuideline] + * @inheritdoc */ - public $guideline; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The system of medicine that includes this MedicalEntity, for example - * 'evidence-based', 'homeopathic', 'chiropractic', etc. - * - * @var MedicineSystem [schema.org types: MedicineSystem] - */ - public $medicineSystem; - /** - * If applicable, the organization that officially recognizes this entity as - * part of its endorsed system of medicine. - * - * @var Organization [schema.org types: Organization] - */ - public $recognizingAuthority; - /** - * If applicable, a medical specialty in which this entity is relevant. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] - */ - public $relevantSpecialty; /** - * A medical study or trial related to this entity. - * - * @var MedicalStudy [schema.org types: MedicalStudy] + * @inheritdoc */ - public $study; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['code', 'guideline', 'legalStatus', 'medicineSystem', 'recognizingAuthority', 'relevantSpecialty', 'study'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalEntityInterface.php b/src/models/jsonld/MedicalEntityInterface.php new file mode 100644 index 000000000..e7577c979 --- /dev/null +++ b/src/models/jsonld/MedicalEntityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalEnumerationInterface.php b/src/models/jsonld/MedicalEnumerationInterface.php new file mode 100644 index 000000000..8a0aa3086 --- /dev/null +++ b/src/models/jsonld/MedicalEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalEvidenceLevelInterface.php b/src/models/jsonld/MedicalEvidenceLevelInterface.php new file mode 100644 index 000000000..17286cbe6 --- /dev/null +++ b/src/models/jsonld/MedicalEvidenceLevelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'evidenceLevel' => ['MedicalEvidenceLevel'], + 'evidenceOrigin' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'guidelineDate' => ['Date'], + 'guidelineSubject' => ['MedicalEntity'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'evidenceLevel', - 'evidenceOrigin', - 'guidelineDate', - 'guidelineSubject' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'evidenceLevel' => ['MedicalEvidenceLevel'], - 'evidenceOrigin' => ['Text'], - 'guidelineDate' => ['Date'], - 'guidelineSubject' => ['MedicalEntity'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'evidenceLevel' => 'Strength of evidence of the data used to formulate the guideline (enumerated).', - 'evidenceOrigin' => 'Source of the data used to formulate the guidance, e.g. RCT, consensus opinion, etc.', - 'guidelineDate' => 'Date on which this guideline\'s recommendation was made.', - 'guidelineSubject' => 'The medical conditions, treatments, etc. that are the subject of the guideline.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'evidenceLevel' => 'Strength of evidence of the data used to formulate the guideline (enumerated).', + 'evidenceOrigin' => 'Source of the data used to formulate the guidance, e.g. RCT, consensus opinion, etc.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'guidelineDate' => 'Date on which this guideline\'s recommendation was made.', + 'guidelineSubject' => 'The medical conditions, treatments, etc. that are the subject of the guideline.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Strength of evidence of the data used to formulate the guideline - * (enumerated). - * - * @var MedicalEvidenceLevel [schema.org types: MedicalEvidenceLevel] - */ - public $evidenceLevel; - /** - * Source of the data used to formulate the guidance, e.g. RCT, consensus - * opinion, etc. - * - * @var string [schema.org types: Text] - */ - public $evidenceOrigin; - /** - * Date on which this guideline's recommendation was made. - * - * @var Date [schema.org types: Date] - */ - public $guidelineDate; /** - * The medical conditions, treatments, etc. that are the subject of the - * guideline. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $guidelineSubject; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['evidenceLevel', 'evidenceOrigin', 'guidelineDate', 'guidelineSubject'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalGuidelineContraindication.php b/src/models/jsonld/MedicalGuidelineContraindication.php index 811cc603b..07b632101 100644 --- a/src/models/jsonld/MedicalGuidelineContraindication.php +++ b/src/models/jsonld/MedicalGuidelineContraindication.php @@ -1,29 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'evidenceLevel' => ['MedicalEvidenceLevel'], + 'evidenceOrigin' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'guidelineDate' => ['Date'], + 'guidelineSubject' => ['MedicalEntity'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'evidenceLevel', - 'evidenceOrigin', - 'guidelineDate', - 'guidelineSubject' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'evidenceLevel' => ['MedicalEvidenceLevel'], - 'evidenceOrigin' => ['Text'], - 'guidelineDate' => ['Date'], - 'guidelineSubject' => ['MedicalEntity'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'evidenceLevel' => 'Strength of evidence of the data used to formulate the guideline (enumerated).', - 'evidenceOrigin' => 'Source of the data used to formulate the guidance, e.g. RCT, consensus opinion, etc.', - 'guidelineDate' => 'Date on which this guideline\'s recommendation was made.', - 'guidelineSubject' => 'The medical conditions, treatments, etc. that are the subject of the guideline.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'evidenceLevel' => 'Strength of evidence of the data used to formulate the guideline (enumerated).', + 'evidenceOrigin' => 'Source of the data used to formulate the guidance, e.g. RCT, consensus opinion, etc.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'guidelineDate' => 'Date on which this guideline\'s recommendation was made.', + 'guidelineSubject' => 'The medical conditions, treatments, etc. that are the subject of the guideline.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Strength of evidence of the data used to formulate the guideline - * (enumerated). - * - * @var MedicalEvidenceLevel [schema.org types: MedicalEvidenceLevel] - */ - public $evidenceLevel; - /** - * Source of the data used to formulate the guidance, e.g. RCT, consensus - * opinion, etc. - * - * @var string [schema.org types: Text] - */ - public $evidenceOrigin; - /** - * Date on which this guideline's recommendation was made. - * - * @var Date [schema.org types: Date] - */ - public $guidelineDate; /** - * The medical conditions, treatments, etc. that are the subject of the - * guideline. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $guidelineSubject; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['evidenceLevel', 'evidenceOrigin', 'guidelineDate', 'guidelineSubject'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalGuidelineContraindicationInterface.php b/src/models/jsonld/MedicalGuidelineContraindicationInterface.php new file mode 100644 index 000000000..4c02a8a1a --- /dev/null +++ b/src/models/jsonld/MedicalGuidelineContraindicationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'evidenceLevel' => ['MedicalEvidenceLevel'], + 'evidenceOrigin' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'guidelineDate' => ['Date'], + 'guidelineSubject' => ['MedicalEntity'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'recommendationStrength' => ['Text'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'recommendationStrength' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'evidenceLevel' => 'Strength of evidence of the data used to formulate the guideline (enumerated).', + 'evidenceOrigin' => 'Source of the data used to formulate the guidance, e.g. RCT, consensus opinion, etc.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'guidelineDate' => 'Date on which this guideline\'s recommendation was made.', + 'guidelineSubject' => 'The medical conditions, treatments, etc. that are the subject of the guideline.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'recommendationStrength' => 'Strength of the guideline\'s recommendation (e.g. \'class I\').', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'recommendationStrength' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'recommendationStrength' => 'Strength of the guideline\'s recommendation (e.g. \'class I\').' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Strength of the guideline's recommendation (e.g. 'class I'). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $recommendationStrength; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['recommendationStrength'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalGuidelineRecommendationInterface.php b/src/models/jsonld/MedicalGuidelineRecommendationInterface.php new file mode 100644 index 000000000..b8b694f13 --- /dev/null +++ b/src/models/jsonld/MedicalGuidelineRecommendationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalImagingTechniqueInterface.php b/src/models/jsonld/MedicalImagingTechniqueInterface.php new file mode 100644 index 000000000..01b8b8f96 --- /dev/null +++ b/src/models/jsonld/MedicalImagingTechniqueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'code', - 'guideline', - 'legalStatus', - 'medicineSystem', - 'recognizingAuthority', - 'relevantSpecialty', - 'study' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'code' => ['MedicalCode'], - 'guideline' => ['MedicalGuideline'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'medicineSystem' => ['MedicineSystem'], - 'recognizingAuthority' => ['Organization'], - 'relevantSpecialty' => ['MedicalSpecialty'], - 'study' => ['MedicalStudy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', - 'guideline' => 'A medical guideline related to this entity.', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', - 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', - 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', - 'study' => 'A medical study or trial related to this entity.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical code for the entity, taken from a controlled vocabulary or - * ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. - * - * @var MedicalCode [schema.org types: MedicalCode] - */ - public $code; - /** - * A medical guideline related to this entity. - * - * @var MedicalGuideline [schema.org types: MedicalGuideline] + * @inheritdoc */ - public $guideline; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The system of medicine that includes this MedicalEntity, for example - * 'evidence-based', 'homeopathic', 'chiropractic', etc. - * - * @var MedicineSystem [schema.org types: MedicineSystem] - */ - public $medicineSystem; - /** - * If applicable, the organization that officially recognizes this entity as - * part of its endorsed system of medicine. - * - * @var Organization [schema.org types: Organization] - */ - public $recognizingAuthority; - /** - * If applicable, a medical specialty in which this entity is relevant. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] - */ - public $relevantSpecialty; /** - * A medical study or trial related to this entity. - * - * @var MedicalStudy [schema.org types: MedicalStudy] + * @inheritdoc */ - public $study; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['code', 'guideline', 'legalStatus', 'medicineSystem', 'recognizingAuthority', 'relevantSpecialty', 'study'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalIndicationInterface.php b/src/models/jsonld/MedicalIndicationInterface.php new file mode 100644 index 000000000..bad9b0be0 --- /dev/null +++ b/src/models/jsonld/MedicalIndicationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'code', - 'guideline', - 'legalStatus', - 'medicineSystem', - 'recognizingAuthority', - 'relevantSpecialty', - 'study' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'code' => ['MedicalCode'], - 'guideline' => ['MedicalGuideline'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'medicineSystem' => ['MedicineSystem'], - 'recognizingAuthority' => ['Organization'], - 'relevantSpecialty' => ['MedicalSpecialty'], - 'study' => ['MedicalStudy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', - 'guideline' => 'A medical guideline related to this entity.', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', - 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', - 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', - 'study' => 'A medical study or trial related to this entity.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical code for the entity, taken from a controlled vocabulary or - * ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. - * - * @var MedicalCode [schema.org types: MedicalCode] - */ - public $code; - /** - * A medical guideline related to this entity. - * - * @var MedicalGuideline [schema.org types: MedicalGuideline] + * @inheritdoc */ - public $guideline; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The system of medicine that includes this MedicalEntity, for example - * 'evidence-based', 'homeopathic', 'chiropractic', etc. - * - * @var MedicineSystem [schema.org types: MedicineSystem] - */ - public $medicineSystem; - /** - * If applicable, the organization that officially recognizes this entity as - * part of its endorsed system of medicine. - * - * @var Organization [schema.org types: Organization] - */ - public $recognizingAuthority; - /** - * If applicable, a medical specialty in which this entity is relevant. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] - */ - public $relevantSpecialty; /** - * A medical study or trial related to this entity. - * - * @var MedicalStudy [schema.org types: MedicalStudy] + * @inheritdoc */ - public $study; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['code', 'guideline', 'legalStatus', 'medicineSystem', 'recognizingAuthority', 'relevantSpecialty', 'study'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalIntangibleInterface.php b/src/models/jsonld/MedicalIntangibleInterface.php new file mode 100644 index 000000000..ac72d5af0 --- /dev/null +++ b/src/models/jsonld/MedicalIntangibleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'healthCondition' => ['MedicalCondition'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'studyDesign' => ['MedicalObservationalStudyDesign'], + 'studyLocation' => ['AdministrativeArea'], + 'studySubject' => ['MedicalEntity'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'studyDesign' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'studyDesign' => 'Specifics about the observational study design (enumerated).', + 'studyLocation' => 'The location in which the study is taking/took place.', + 'studySubject' => 'A subject of the study, i.e. one of the medical conditions, therapies, devices, drugs, etc. investigated by the study.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'studyDesign' => ['MedicalObservationalStudyDesign'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'studyDesign' => 'Specifics about the observational study design (enumerated).' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Specifics about the observational study design (enumerated). - * - * @var MedicalObservationalStudyDesign [schema.org types: MedicalObservationalStudyDesign] + * @inheritdoc */ - public $studyDesign; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['studyDesign'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalObservationalStudyDesign.php b/src/models/jsonld/MedicalObservationalStudyDesign.php index d69be8ccc..1912f90a8 100644 --- a/src/models/jsonld/MedicalObservationalStudyDesign.php +++ b/src/models/jsonld/MedicalObservationalStudyDesign.php @@ -1,28 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalObservationalStudyDesignInterface.php b/src/models/jsonld/MedicalObservationalStudyDesignInterface.php new file mode 100644 index 000000000..14acd5e14 --- /dev/null +++ b/src/models/jsonld/MedicalObservationalStudyDesignInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthPlanNetworkId' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAcceptingNewPatients' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'medicalSpecialty' => ['MedicalSpecialty'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'healthPlanNetworkId', - 'isAcceptingNewPatients', - 'medicalSpecialty' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'healthPlanNetworkId' => ['Text'], - 'isAcceptingNewPatients' => ['Boolean'], - 'medicalSpecialty' => ['MedicalSpecialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', - 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', - 'medicalSpecialty' => 'A medical specialty of the provider.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'medicalSpecialty' => 'A medical specialty of the provider.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Name or unique ID of network. (Networks are often reused across different - * insurance plans). - * - * @var string [schema.org types: Text] - */ - public $healthPlanNetworkId; - /** - * Whether the provider is accepting new patients. - * - * @var bool [schema.org types: Boolean] - */ - public $isAcceptingNewPatients; /** - * A medical specialty of the provider. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] + * @inheritdoc */ - public $medicalSpecialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['healthPlanNetworkId', 'isAcceptingNewPatients', 'medicalSpecialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalOrganizationInterface.php b/src/models/jsonld/MedicalOrganizationInterface.php new file mode 100644 index 000000000..5ba09370e --- /dev/null +++ b/src/models/jsonld/MedicalOrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bodyLocation', - 'followup', - 'howPerformed', - 'preparation', - 'procedureType', - 'status' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bodyLocation' => ['Text'], - 'followup' => ['Text'], - 'howPerformed' => ['Text'], - 'preparation' => ['MedicalEntity', 'Text'], - 'procedureType' => ['MedicalProcedureType'], - 'status' => ['EventStatusType', 'MedicalStudyStatus', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bodyLocation' => 'Location in the body of the anatomical structure.', - 'followup' => 'Typical or recommended followup care after the procedure is performed.', - 'howPerformed' => 'How the procedure is performed.', - 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', - 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', - 'status' => 'The status of the study (enumerated).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * Location in the body of the anatomical structure. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $bodyLocation; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Typical or recommended followup care after the procedure is performed. - * - * @var string [schema.org types: Text] - */ - public $followup; /** - * How the procedure is performed. - * - * @var string [schema.org types: Text] - */ - public $howPerformed; - /** - * Typical preparation that a patient must undergo before having the procedure - * performed. - * - * @var mixed|MedicalEntity|string [schema.org types: MedicalEntity, Text] - */ - public $preparation; - /** - * The type of procedure, for example Surgical, Noninvasive, or Percutaneous. - * - * @var MedicalProcedureType [schema.org types: MedicalProcedureType] - */ - public $procedureType; - /** - * The status of the study (enumerated). - * - * @var mixed|EventStatusType|MedicalStudyStatus|string [schema.org types: EventStatusType, MedicalStudyStatus, Text] + * @inheritdoc */ - public $status; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bodyLocation', 'followup', 'howPerformed', 'preparation', 'procedureType', 'status'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalProcedureInterface.php b/src/models/jsonld/MedicalProcedureInterface.php new file mode 100644 index 000000000..a2eefe1d4 --- /dev/null +++ b/src/models/jsonld/MedicalProcedureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalProcedureTypeInterface.php b/src/models/jsonld/MedicalProcedureTypeInterface.php new file mode 100644 index 000000000..6c47b82e0 --- /dev/null +++ b/src/models/jsonld/MedicalProcedureTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalResearcherInterface.php b/src/models/jsonld/MedicalResearcherInterface.php new file mode 100644 index 000000000..715d4b912 --- /dev/null +++ b/src/models/jsonld/MedicalResearcherInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'estimatesRiskOf' => ['MedicalEntity'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includedRiskFactor' => ['MedicalRiskFactor'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'estimatesRiskOf', - 'includedRiskFactor' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'estimatesRiskOf' => ['MedicalEntity'], - 'includedRiskFactor' => ['MedicalRiskFactor'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'estimatesRiskOf' => 'The condition, complication, or symptom whose risk is being estimated.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includedRiskFactor' => 'A modifiable or non-modifiable risk factor included in the calculation, e.g. age, coexisting condition.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'estimatesRiskOf' => 'The condition, complication, or symptom whose risk is being estimated.', - 'includedRiskFactor' => 'A modifiable or non-modifiable risk factor included in the calculation, e.g. age, coexisting condition.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The condition, complication, or symptom whose risk is being estimated. - * - * @var MedicalEntity [schema.org types: MedicalEntity] - */ - public $estimatesRiskOf; - /** - * A modifiable or non-modifiable risk factor included in the calculation, - * e.g. age, coexisting condition. - * - * @var MedicalRiskFactor [schema.org types: MedicalRiskFactor] + * @inheritdoc */ - public $includedRiskFactor; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['estimatesRiskOf', 'includedRiskFactor'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalRiskCalculatorInterface.php b/src/models/jsonld/MedicalRiskCalculatorInterface.php new file mode 100644 index 000000000..24a9bc275 --- /dev/null +++ b/src/models/jsonld/MedicalRiskCalculatorInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'estimatesRiskOf' => ['MedicalEntity'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includedRiskFactor' => ['MedicalRiskFactor'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'estimatesRiskOf', - 'includedRiskFactor' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'estimatesRiskOf' => ['MedicalEntity'], - 'includedRiskFactor' => ['MedicalRiskFactor'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'estimatesRiskOf' => 'The condition, complication, or symptom whose risk is being estimated.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includedRiskFactor' => 'A modifiable or non-modifiable risk factor included in the calculation, e.g. age, coexisting condition.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'estimatesRiskOf' => 'The condition, complication, or symptom whose risk is being estimated.', - 'includedRiskFactor' => 'A modifiable or non-modifiable risk factor included in the calculation, e.g. age, coexisting condition.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The condition, complication, or symptom whose risk is being estimated. - * - * @var MedicalEntity [schema.org types: MedicalEntity] - */ - public $estimatesRiskOf; - /** - * A modifiable or non-modifiable risk factor included in the calculation, - * e.g. age, coexisting condition. - * - * @var MedicalRiskFactor [schema.org types: MedicalRiskFactor] + * @inheritdoc */ - public $includedRiskFactor; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['estimatesRiskOf', 'includedRiskFactor'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalRiskEstimatorInterface.php b/src/models/jsonld/MedicalRiskEstimatorInterface.php new file mode 100644 index 000000000..e379e1e3c --- /dev/null +++ b/src/models/jsonld/MedicalRiskEstimatorInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'increasesRiskOf' => ['MedicalEntity'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'increasesRiskOf' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'increasesRiskOf' => 'The condition, complication, etc. influenced by this factor.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'increasesRiskOf' => ['MedicalEntity'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'increasesRiskOf' => 'The condition, complication, etc. influenced by this factor.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The condition, complication, etc. influenced by this factor. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $increasesRiskOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['increasesRiskOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalRiskFactorInterface.php b/src/models/jsonld/MedicalRiskFactorInterface.php new file mode 100644 index 000000000..a16c67703 --- /dev/null +++ b/src/models/jsonld/MedicalRiskFactorInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'algorithm' => ['Text'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'estimatesRiskOf' => ['MedicalEntity'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includedRiskFactor' => ['MedicalRiskFactor'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'algorithm' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'algorithm' => 'The algorithm or rules to follow to compute the score.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'estimatesRiskOf' => 'The condition, complication, or symptom whose risk is being estimated.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includedRiskFactor' => 'A modifiable or non-modifiable risk factor included in the calculation, e.g. age, coexisting condition.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'algorithm' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'algorithm' => 'The algorithm or rules to follow to compute the score.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The algorithm or rules to follow to compute the score. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $algorithm; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['algorithm'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalRiskScoreInterface.php b/src/models/jsonld/MedicalRiskScoreInterface.php new file mode 100644 index 000000000..3b53ec0c3 --- /dev/null +++ b/src/models/jsonld/MedicalRiskScoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publicationType' => ['Text'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'publicationType' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publicationType' => 'The type of the medical article, taken from the US NLM MeSH publication type catalog. See also [MeSH documentation](http://www.nlm.nih.gov/mesh/pubtypes.html).', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'publicationType' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'publicationType' => 'The type of the medical article, taken from the US NLM MeSH publication type catalog. See also MeSH documentation.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The type of the medical article, taken from the US NLM MeSH publication - * type catalog. See also MeSH documentation. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $publicationType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['publicationType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalScholarlyArticleInterface.php b/src/models/jsonld/MedicalScholarlyArticleInterface.php new file mode 100644 index 000000000..e253c6c4b --- /dev/null +++ b/src/models/jsonld/MedicalScholarlyArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'differentialDiagnosis' => ['DDxElement'], + 'disambiguatingDescription' => ['Text'], + 'drug' => ['Drug'], + 'epidemiology' => ['Text'], + 'expectedPrognosis' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'identifyingExam' => ['PhysicalExam'], + 'identifyingTest' => ['MedicalTest'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'naturalProgression' => ['Text'], + 'pathophysiology' => ['Text'], + 'possibleComplication' => ['Text'], + 'possibleTreatment' => ['MedicalTherapy'], + 'potentialAction' => ['Action'], + 'primaryPrevention' => ['MedicalTherapy'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'riskFactor' => ['MedicalRiskFactor'], + 'sameAs' => ['URL'], + 'secondaryPrevention' => ['MedicalTherapy'], + 'signOrSymptom' => ['MedicalSignOrSymptom'], + 'stage' => ['MedicalConditionStage'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'typicalTest' => ['MedicalTest'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'identifyingExam', - 'identifyingTest' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'identifyingExam' => ['PhysicalExam'], - 'identifyingTest' => ['MedicalTest'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + 'differentialDiagnosis' => 'One of a set of differential diagnoses for the condition. Specifically, a closely-related or competing diagnosis typically considered later in the cognitive process whereby this medical condition is distinguished from others most likely responsible for a similar collection of signs and symptoms to reach the most parsimonious diagnosis or diagnoses in a patient.', + '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.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', + 'expectedPrognosis' => 'The likely outcome in either the short term or long term of the medical condition.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'identifyingExam' => 'A physical examination that can identify this sign.', + 'identifyingTest' => 'A diagnostic test that can identify this sign.', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'naturalProgression' => 'The expected progression of the condition if it is not treated and allowed to progress naturally.', + 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.', + 'possibleComplication' => 'A possible unexpected and unfavorable evolution of a medical condition. Complications may include worsening of the signs or symptoms of the disease, extension of the condition to other organ systems, etc.', + 'possibleTreatment' => 'A possible treatment to address this condition, sign or symptom.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryPrevention' => 'A preventative therapy used to prevent an initial occurrence of the medical condition, such as vaccination.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'riskFactor' => 'A modifiable or non-modifiable factor that increases the risk of a patient contracting this condition, e.g. age, coexisting condition.', + '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.', + 'secondaryPrevention' => 'A preventative therapy used to prevent reoccurrence of the medical condition after an initial episode of the condition.', + 'signOrSymptom' => 'A sign or symptom of this condition. Signs are objective or physically observable manifestations of the medical condition while symptoms are the subjective experience of the medical condition.', + 'stage' => 'The stage of the condition, if applicable.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'typicalTest' => 'A medical test typically performed given this condition.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'identifyingExam' => 'A physical examination that can identify this sign.', - 'identifyingTest' => 'A diagnostic test that can identify this sign.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A physical examination that can identify this sign. - * - * @var PhysicalExam [schema.org types: PhysicalExam] - */ - public $identifyingExam; - /** - * A diagnostic test that can identify this sign. - * - * @var MedicalTest [schema.org types: MedicalTest] + * @inheritdoc */ - public $identifyingTest; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['identifyingExam', 'identifyingTest'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalSignInterface.php b/src/models/jsonld/MedicalSignInterface.php new file mode 100644 index 000000000..e867307ac --- /dev/null +++ b/src/models/jsonld/MedicalSignInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'differentialDiagnosis' => ['DDxElement'], + 'disambiguatingDescription' => ['Text'], + 'drug' => ['Drug'], + 'epidemiology' => ['Text'], + 'expectedPrognosis' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'naturalProgression' => ['Text'], + 'pathophysiology' => ['Text'], + 'possibleComplication' => ['Text'], + 'possibleTreatment' => ['MedicalTherapy'], + 'potentialAction' => ['Action'], + 'primaryPrevention' => ['MedicalTherapy'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'riskFactor' => ['MedicalRiskFactor'], + 'sameAs' => ['URL'], + 'secondaryPrevention' => ['MedicalTherapy'], + 'signOrSymptom' => ['MedicalSignOrSymptom'], + 'stage' => ['MedicalConditionStage'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'typicalTest' => ['MedicalTest'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'possibleTreatment' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + 'differentialDiagnosis' => 'One of a set of differential diagnoses for the condition. Specifically, a closely-related or competing diagnosis typically considered later in the cognitive process whereby this medical condition is distinguished from others most likely responsible for a similar collection of signs and symptoms to reach the most parsimonious diagnosis or diagnoses in a patient.', + '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.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', + 'expectedPrognosis' => 'The likely outcome in either the short term or long term of the medical condition.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'naturalProgression' => 'The expected progression of the condition if it is not treated and allowed to progress naturally.', + 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.', + 'possibleComplication' => 'A possible unexpected and unfavorable evolution of a medical condition. Complications may include worsening of the signs or symptoms of the disease, extension of the condition to other organ systems, etc.', + 'possibleTreatment' => 'A possible treatment to address this condition, sign or symptom.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryPrevention' => 'A preventative therapy used to prevent an initial occurrence of the medical condition, such as vaccination.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'riskFactor' => 'A modifiable or non-modifiable factor that increases the risk of a patient contracting this condition, e.g. age, coexisting condition.', + '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.', + 'secondaryPrevention' => 'A preventative therapy used to prevent reoccurrence of the medical condition after an initial episode of the condition.', + 'signOrSymptom' => 'A sign or symptom of this condition. Signs are objective or physically observable manifestations of the medical condition while symptoms are the subjective experience of the medical condition.', + 'stage' => 'The stage of the condition, if applicable.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'typicalTest' => 'A medical test typically performed given this condition.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'possibleTreatment' => ['MedicalTherapy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'possibleTreatment' => 'A possible treatment to address this condition, sign or symptom.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A possible treatment to address this condition, sign or symptom. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] + * @inheritdoc */ - public $possibleTreatment; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['possibleTreatment'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalSignOrSymptomInterface.php b/src/models/jsonld/MedicalSignOrSymptomInterface.php new file mode 100644 index 000000000..3c98ad42e --- /dev/null +++ b/src/models/jsonld/MedicalSignOrSymptomInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalSpecialtyInterface.php b/src/models/jsonld/MedicalSpecialtyInterface.php new file mode 100644 index 000000000..23b10b768 --- /dev/null +++ b/src/models/jsonld/MedicalSpecialtyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'healthCondition' => ['MedicalCondition'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'studyLocation' => ['AdministrativeArea'], + 'studySubject' => ['MedicalEntity'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'healthCondition', - 'sponsor', - 'status', - 'studyLocation', - 'studySubject' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'healthCondition' => ['MedicalCondition'], - 'sponsor' => ['Organization', 'Person'], - 'status' => ['EventStatusType', 'MedicalStudyStatus', 'Text'], - 'studyLocation' => ['AdministrativeArea'], - 'studySubject' => ['MedicalEntity'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.', - '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.', - 'status' => 'The status of the study (enumerated).', - 'studyLocation' => 'The location in which the study is taking/took place.', - 'studySubject' => 'A subject of the study, i.e. one of the medical conditions, therapies, devices, drugs, etc. investigated by the study.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'studyLocation' => 'The location in which the study is taking/took place.', + 'studySubject' => 'A subject of the study, i.e. one of the medical conditions, therapies, devices, drugs, etc. investigated by the study.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * Specifying the health condition(s) of a patient, medical study, or other - * target audience. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $healthCondition; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The status of the study (enumerated). - * - * @var mixed|EventStatusType|MedicalStudyStatus|string [schema.org types: EventStatusType, MedicalStudyStatus, Text] - */ - public $status; - /** - * The location in which the study is taking/took place. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] - */ - public $studyLocation; - /** - * A subject of the study, i.e. one of the medical conditions, therapies, - * devices, drugs, etc. investigated by the study. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $studySubject; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['healthCondition', 'sponsor', 'status', 'studyLocation', 'studySubject'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalStudyInterface.php b/src/models/jsonld/MedicalStudyInterface.php new file mode 100644 index 000000000..46a0beaf6 --- /dev/null +++ b/src/models/jsonld/MedicalStudyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalStudyStatusInterface.php b/src/models/jsonld/MedicalStudyStatusInterface.php new file mode 100644 index 000000000..0f5287f07 --- /dev/null +++ b/src/models/jsonld/MedicalStudyStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'differentialDiagnosis' => ['DDxElement'], + 'disambiguatingDescription' => ['Text'], + 'drug' => ['Drug'], + 'epidemiology' => ['Text'], + 'expectedPrognosis' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'naturalProgression' => ['Text'], + 'pathophysiology' => ['Text'], + 'possibleComplication' => ['Text'], + 'possibleTreatment' => ['MedicalTherapy'], + 'potentialAction' => ['Action'], + 'primaryPrevention' => ['MedicalTherapy'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'riskFactor' => ['MedicalRiskFactor'], + 'sameAs' => ['URL'], + 'secondaryPrevention' => ['MedicalTherapy'], + 'signOrSymptom' => ['MedicalSignOrSymptom'], + 'stage' => ['MedicalConditionStage'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'typicalTest' => ['MedicalTest'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'possibleTreatment' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + 'differentialDiagnosis' => 'One of a set of differential diagnoses for the condition. Specifically, a closely-related or competing diagnosis typically considered later in the cognitive process whereby this medical condition is distinguished from others most likely responsible for a similar collection of signs and symptoms to reach the most parsimonious diagnosis or diagnoses in a patient.', + '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.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', + 'expectedPrognosis' => 'The likely outcome in either the short term or long term of the medical condition.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'naturalProgression' => 'The expected progression of the condition if it is not treated and allowed to progress naturally.', + 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.', + 'possibleComplication' => 'A possible unexpected and unfavorable evolution of a medical condition. Complications may include worsening of the signs or symptoms of the disease, extension of the condition to other organ systems, etc.', + 'possibleTreatment' => 'A possible treatment to address this condition, sign or symptom.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryPrevention' => 'A preventative therapy used to prevent an initial occurrence of the medical condition, such as vaccination.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'riskFactor' => 'A modifiable or non-modifiable factor that increases the risk of a patient contracting this condition, e.g. age, coexisting condition.', + '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.', + 'secondaryPrevention' => 'A preventative therapy used to prevent reoccurrence of the medical condition after an initial episode of the condition.', + 'signOrSymptom' => 'A sign or symptom of this condition. Signs are objective or physically observable manifestations of the medical condition while symptoms are the subjective experience of the medical condition.', + 'stage' => 'The stage of the condition, if applicable.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'typicalTest' => 'A medical test typically performed given this condition.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'possibleTreatment' => ['MedicalTherapy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'possibleTreatment' => 'A possible treatment to address this condition, sign or symptom.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A possible treatment to address this condition, sign or symptom. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] + * @inheritdoc */ - public $possibleTreatment; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['possibleTreatment'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalSymptomInterface.php b/src/models/jsonld/MedicalSymptomInterface.php new file mode 100644 index 000000000..3b1dfd892 --- /dev/null +++ b/src/models/jsonld/MedicalSymptomInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'affectedBy' => ['Drug'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'normalRange' => ['Text', 'MedicalEnumeration'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'signDetected' => ['MedicalSign'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'usedToDiagnose' => ['MedicalCondition'], + 'usesDevice' => ['MedicalDevice'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'affectedBy', - 'normalRange', - 'signDetected', - 'usedToDiagnose', - 'usesDevice' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'affectedBy' => ['Drug'], - 'normalRange' => ['MedicalEnumeration', 'Text'], - 'signDetected' => ['MedicalSign'], - 'usedToDiagnose' => ['MedicalCondition'], - 'usesDevice' => ['MedicalDevice'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'affectedBy' => 'Drugs that affect the test\'s results.', - 'normalRange' => 'Range of acceptable values for a typical patient, when applicable.', - 'signDetected' => 'A sign detected by the test.', - 'usedToDiagnose' => 'A condition the test is used to diagnose.', - 'usesDevice' => 'Device used to perform the test.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'affectedBy' => 'Drugs that affect the test\'s results.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'normalRange' => 'Range of acceptable values for a typical patient, when applicable.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'signDetected' => 'A sign detected by the test.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'usedToDiagnose' => 'A condition the test is used to diagnose.', + 'usesDevice' => 'Device used to perform the test.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * Drugs that affect the test's results. - * - * @var Drug [schema.org types: Drug] - */ - public $affectedBy; - /** - * Range of acceptable values for a typical patient, when applicable. - * - * @var mixed|MedicalEnumeration|string [schema.org types: MedicalEnumeration, Text] - */ - public $normalRange; - /** - * A sign detected by the test. - * - * @var MedicalSign [schema.org types: MedicalSign] - */ - public $signDetected; - /** - * A condition the test is used to diagnose. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $usedToDiagnose; - /** - * Device used to perform the test. - * - * @var MedicalDevice [schema.org types: MedicalDevice] + * @inheritdoc */ - public $usesDevice; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['affectedBy', 'normalRange', 'signDetected', 'usedToDiagnose', 'usesDevice'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalTestInterface.php b/src/models/jsonld/MedicalTestInterface.php new file mode 100644 index 000000000..cd2fea725 --- /dev/null +++ b/src/models/jsonld/MedicalTestInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'affectedBy' => ['Drug'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'normalRange' => ['Text', 'MedicalEnumeration'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'signDetected' => ['MedicalSign'], + 'study' => ['MedicalStudy'], + 'subTest' => ['MedicalTest'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'usedToDiagnose' => ['MedicalCondition'], + 'usesDevice' => ['MedicalDevice'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'subTest' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'affectedBy' => 'Drugs that affect the test\'s results.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'normalRange' => 'Range of acceptable values for a typical patient, when applicable.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'signDetected' => 'A sign detected by the test.', + 'study' => 'A medical study or trial related to this entity.', + 'subTest' => 'A component test of the panel.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'usedToDiagnose' => 'A condition the test is used to diagnose.', + 'usesDevice' => 'Device used to perform the test.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'subTest' => ['MedicalTest'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'subTest' => 'A component test of the panel.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A component test of the panel. - * - * @var MedicalTest [schema.org types: MedicalTest] + * @inheritdoc */ - public $subTest; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['subTest'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalTestPanelInterface.php b/src/models/jsonld/MedicalTestPanelInterface.php new file mode 100644 index 000000000..69c420073 --- /dev/null +++ b/src/models/jsonld/MedicalTestPanelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'adverseOutcome' => ['MedicalEntity'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'contraindication' => ['Text', 'MedicalContraindication'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseSchedule' => ['DoseSchedule'], + 'drug' => ['Drug'], + 'duplicateTherapy' => ['MedicalTherapy'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'seriousAdverseOutcome' => ['MedicalEntity'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'contraindication', - 'duplicateTherapy', - 'seriousAdverseOutcome' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'contraindication' => ['MedicalContraindication', 'Text'], - 'duplicateTherapy' => ['MedicalTherapy'], - 'seriousAdverseOutcome' => ['MedicalEntity'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'contraindication' => 'A contraindication for this therapy.', - 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', - 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'contraindication' => 'A contraindication for this therapy.', + 'description' => 'A description of the item.', + '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.', + 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A contraindication for this therapy. - * - * @var mixed|MedicalContraindication|string [schema.org types: MedicalContraindication, Text] - */ - public $contraindication; - /** - * A therapy that duplicates or overlaps this one. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $duplicateTherapy; /** - * A possible serious complication and/or serious side effect of this therapy. - * Serious adverse outcomes include those that are life-threatening; result in - * death, disability, or permanent damage; require hospitalization or prolong - * existing hospitalization; cause congenital anomalies or birth defects; or - * jeopardize the patient and may require medical or surgical intervention to - * prevent one of the outcomes in this definition. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $seriousAdverseOutcome; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['contraindication', 'duplicateTherapy', 'seriousAdverseOutcome'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalTherapyInterface.php b/src/models/jsonld/MedicalTherapyInterface.php new file mode 100644 index 000000000..c417e7bc5 --- /dev/null +++ b/src/models/jsonld/MedicalTherapyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'healthCondition' => ['MedicalCondition'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'studyLocation' => ['AdministrativeArea'], + 'studySubject' => ['MedicalEntity'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'trialDesign' => ['MedicalTrialDesign'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'trialDesign' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'studyLocation' => 'The location in which the study is taking/took place.', + 'studySubject' => 'A subject of the study, i.e. one of the medical conditions, therapies, devices, drugs, etc. investigated by the study.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'trialDesign' => 'Specifics about the trial design (enumerated).', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'trialDesign' => ['MedicalTrialDesign'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'trialDesign' => 'Specifics about the trial design (enumerated).' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Specifics about the trial design (enumerated). - * - * @var MedicalTrialDesign [schema.org types: MedicalTrialDesign] + * @inheritdoc */ - public $trialDesign; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['trialDesign'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalTrialDesign.php b/src/models/jsonld/MedicalTrialDesign.php index cc58f5a03..9cff25dab 100644 --- a/src/models/jsonld/MedicalTrialDesign.php +++ b/src/models/jsonld/MedicalTrialDesign.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalTrialDesignInterface.php b/src/models/jsonld/MedicalTrialDesignInterface.php new file mode 100644 index 000000000..87793532e --- /dev/null +++ b/src/models/jsonld/MedicalTrialDesignInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'aspect' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'medicalAudience' => ['MedicalAudienceType', 'MedicalAudience'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'aspect' => 'An aspect of medical practice that is considered on the page, such as \'diagnosis\', \'treatment\', \'causes\', \'prognosis\', \'etiology\', \'epidemiology\', etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'medicalAudience' => 'Medical audience for page.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicalWebPageInterface.php b/src/models/jsonld/MedicalWebPageInterface.php new file mode 100644 index 000000000..4c70098a9 --- /dev/null +++ b/src/models/jsonld/MedicalWebPageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MedicineSystemInterface.php b/src/models/jsonld/MedicineSystemInterface.php new file mode 100644 index 000000000..fc7cefc1c --- /dev/null +++ b/src/models/jsonld/MedicineSystemInterface.php @@ -0,0 +1,24 @@ +http://en.wikipedia.org/wiki/Conference_hall). + * See also the dedicated document on the use + * of schema.org for marking up hotels and other forms of accommodations. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/MeetingRoom + * @see https://schema.org/MeetingRoom */ -class MeetingRoom extends Room +class MeetingRoom extends MetaJsonLd implements MeetingRoomInterface, RoomInterface, AccommodationInterface, PlaceInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -36,308 +36,234 @@ class MeetingRoom extends Room * * @var string */ - static public $schemaTypeName = 'MeetingRoom'; + static public string $schemaTypeName = 'MeetingRoom'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/MeetingRoom'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'A meeting room, conference room, or conference hall is a room provided for singular events such as business conferences and meetings (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Conference_hall). See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/MeetingRoom'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Room'; + static public string $schemaTypeExtends = 'Room'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<http://en.wikipedia.org/wiki/Conference_hall). +

+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use MeetingRoomTrait; + use RoomTrait; + use AccommodationTrait; + use PlaceTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationCategory' => ['Text'], + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'floorLevel' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'permittedUsage' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'], + 'yearBuilt' => ['Number'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accommodationCategory', - 'accommodationFloorPlan', - 'amenityFeature', - 'floorLevel', - 'floorSize', - 'leaseLength', - 'numberOfBathroomsTotal', - 'numberOfBedrooms', - 'numberOfFullBathrooms', - 'numberOfPartialBathrooms', - 'numberOfRooms', - 'permittedUsage', - 'petsAllowed', - 'tourBookingPage', - 'yearBuilt' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accommodationCategory' => ['Text'], - 'accommodationFloorPlan' => ['FloorPlan'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'floorLevel' => ['Text'], - 'floorSize' => ['QuantitativeValue'], - 'leaseLength' => ['Duration', 'QuantitativeValue'], - 'numberOfBathroomsTotal' => ['Integer'], - 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], - 'numberOfFullBathrooms' => ['Number'], - 'numberOfPartialBathrooms' => ['Number'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'permittedUsage' => ['Text'], - 'petsAllowed' => ['Boolean', 'Text'], - 'tourBookingPage' => ['URL'], - 'yearBuilt' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accommodationCategory' => 'Category of an Accommodation, following real estate conventions e.g. RESO (see PropertySubType, and PropertyType fields for suggested values).', - 'accommodationFloorPlan' => 'A floorplan of some Accommodation.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'floorLevel' => 'The floor level for an Accommodation in a multi-storey building. Since counting systems vary internationally, the local system should be used where possible.', - 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard', - 'leaseLength' => 'Length of the lease for some Accommodation, either particular to some Offer or in some cases intrinsic to the property.', - 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some Accommodation, following real estate conventions as documented in RESO: "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also numberOfRooms.', - 'numberOfBedrooms' => 'The total integer number of bedrooms in a some Accommodation, ApartmentComplex or FloorPlan.', - 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an Accommodation. This corresponds to the BathroomsFull field in RESO.', - 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an Accommodation. This corresponds to the BathroomsPartial field in RESO.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.', - 'yearBuilt' => 'The year an Accommodation was constructed. This corresponds to the YearBuilt field in RESO.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Category of an Accommodation, following real estate conventions e.g. RESO - * (see PropertySubType, and PropertyType fields for suggested values). - * - * @var string [schema.org types: Text] - */ - public $accommodationCategory; - /** - * A floorplan of some Accommodation. - * - * @var FloorPlan [schema.org types: FloorPlan] - */ - public $accommodationFloorPlan; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * The floor level for an Accommodation in a multi-storey building. Since - * counting systems vary internationally, the local system should be used - * where possible. - * - * @var string [schema.org types: Text] - */ - public $floorLevel; - /** - * The size of the accommodation, e.g. in square meter or squarefoot. Typical - * unit code(s): MTK for square meter, FTK for square foot, or YDK for square - * yard - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $floorSize; - /** - * Length of the lease for some Accommodation, either particular to some Offer - * or in some cases intrinsic to the property. - * - * @var mixed|Duration|QuantitativeValue [schema.org types: Duration, QuantitativeValue] - */ - public $leaseLength; - /** - * The total integer number of bathrooms in a some Accommodation, following - * real estate conventions as documented in RESO: "The simple sum of the - * number of bathrooms. For example for a property with two Full Bathrooms and - * one Half Bathroom, the Bathrooms Total Integer will be 3.". See also - * numberOfRooms. - * - * @var int [schema.org types: Integer] - */ - public $numberOfBathroomsTotal; - /** - * The total integer number of bedrooms in a some Accommodation, - * ApartmentComplex or FloorPlan. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfBedrooms; - /** - * Number of full bathrooms - The total number of full and ¾ bathrooms in an - * Accommodation. This corresponds to the BathroomsFull field in RESO. - * - * @var float [schema.org types: Number] - */ - public $numberOfFullBathrooms; - /** - * Number of partial bathrooms - The total number of half and ¼ bathrooms in - * an Accommodation. This corresponds to the BathroomsPartial field in RESO. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $numberOfPartialBathrooms; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationCategory' => 'Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values).', + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'floorLevel' => 'The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.', + 'yearBuilt' => 'The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). ' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; - /** - * Indications regarding the permitted usage of the accommodation. - * - * @var string [schema.org types: Text] - */ - public $permittedUsage; - /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] - */ - public $tourBookingPage; - /** - * The year an Accommodation was constructed. This corresponds to the - * YearBuilt field in RESO. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $yearBuilt; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accommodationCategory', 'accommodationFloorPlan', 'amenityFeature', 'floorLevel', 'floorSize', 'leaseLength', 'numberOfBathroomsTotal', 'numberOfBedrooms', 'numberOfFullBathrooms', 'numberOfPartialBathrooms', 'numberOfRooms', 'permittedUsage', 'petsAllowed', 'tourBookingPage', 'yearBuilt'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MeetingRoomInterface.php b/src/models/jsonld/MeetingRoomInterface.php new file mode 100644 index 000000000..550dac049 --- /dev/null +++ b/src/models/jsonld/MeetingRoomInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MensClothingStoreInterface.php b/src/models/jsonld/MensClothingStoreInterface.php new file mode 100644 index 000000000..46584aaf3 --- /dev/null +++ b/src/models/jsonld/MensClothingStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasMenuItem' => ['MenuItem'], + 'hasMenuSection' => ['MenuSection'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'hasMenuItem', - 'hasMenuSection' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasMenuItem' => ['MenuItem'], - 'hasMenuSection' => ['MenuSection'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasMenuItem' => 'A food or drink item contained in a menu or menu section.', + 'hasMenuSection' => 'A subgrouping of the menu (by dishes, course, serving time period, etc.).', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasMenuItem' => 'A food or drink item contained in a menu or menu section.', - 'hasMenuSection' => 'A subgrouping of the menu (by dishes, course, serving time period, etc.).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A food or drink item contained in a menu or menu section. - * - * @var MenuItem [schema.org types: MenuItem] - */ - public $hasMenuItem; - /** - * A subgrouping of the menu (by dishes, course, serving time period, etc.). - * - * @var MenuSection [schema.org types: MenuSection] + * @inheritdoc */ - public $hasMenuSection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasMenuItem', 'hasMenuSection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MenuInterface.php b/src/models/jsonld/MenuInterface.php new file mode 100644 index 000000000..c0f48f7e6 --- /dev/null +++ b/src/models/jsonld/MenuInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'menuAddOn' => ['MenuItem', 'MenuSection'], + 'name' => ['Text'], + 'nutrition' => ['NutritionInformation'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'suitableForDiet' => ['RestrictedDiet'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'menuAddOn', - 'nutrition', - 'offers', - 'suitableForDiet' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'menuAddOn' => ['MenuItem', 'MenuSection'], - 'nutrition' => ['NutritionInformation'], - 'offers' => ['Demand', 'Offer'], - 'suitableForDiet' => ['RestrictedDiet'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'menuAddOn' => 'Additional menu item(s) such as a side dish of salad or side order of fries that can be added to this menu item. Additionally it can be a menu section containing allowed add-on menu items for this menu item.', - 'nutrition' => 'Nutrition information about the recipe or menu item.', - '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. Inverse property: itemOffered.', - 'suitableForDiet' => 'Indicates a dietary restriction or guideline for which this recipe or menu item is suitable, e.g. diabetic, halal etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'menuAddOn' => 'Additional menu item(s) such as a side dish of salad or side order of fries that can be added to this menu item. Additionally it can be a menu section containing allowed add-on menu items for this menu item.', + 'name' => 'The name of the item.', + 'nutrition' => 'Nutrition information about the recipe or menu item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'suitableForDiet' => 'Indicates a dietary restriction or guideline for which this recipe or menu item is suitable, e.g. diabetic, halal etc.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Additional menu item(s) such as a side dish of salad or side order of fries - * that can be added to this menu item. Additionally it can be a menu section - * containing allowed add-on menu items for this menu item. - * - * @var mixed|MenuItem|MenuSection [schema.org types: MenuItem, MenuSection] - */ - public $menuAddOn; - /** - * Nutrition information about the recipe or menu item. - * - * @var NutritionInformation [schema.org types: NutritionInformation] - */ - public $nutrition; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; /** - * Indicates a dietary restriction or guideline for which this recipe or menu - * item is suitable, e.g. diabetic, halal etc. - * - * @var RestrictedDiet [schema.org types: RestrictedDiet] + * @inheritdoc */ - public $suitableForDiet; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['menuAddOn', 'nutrition', 'offers', 'suitableForDiet'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MenuItemInterface.php b/src/models/jsonld/MenuItemInterface.php new file mode 100644 index 000000000..9a6b6b163 --- /dev/null +++ b/src/models/jsonld/MenuItemInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasMenuItem' => ['MenuItem'], + 'hasMenuSection' => ['MenuSection'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'hasMenuItem', - 'hasMenuSection' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasMenuItem' => ['MenuItem'], - 'hasMenuSection' => ['MenuSection'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasMenuItem' => 'A food or drink item contained in a menu or menu section.', + 'hasMenuSection' => 'A subgrouping of the menu (by dishes, course, serving time period, etc.).', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasMenuItem' => 'A food or drink item contained in a menu or menu section.', - 'hasMenuSection' => 'A subgrouping of the menu (by dishes, course, serving time period, etc.).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A food or drink item contained in a menu or menu section. - * - * @var MenuItem [schema.org types: MenuItem] - */ - public $hasMenuItem; - /** - * A subgrouping of the menu (by dishes, course, serving time period, etc.). - * - * @var MenuSection [schema.org types: MenuSection] + * @inheritdoc */ - public $hasMenuSection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasMenuItem', 'hasMenuSection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MenuSectionInterface.php b/src/models/jsonld/MenuSectionInterface.php new file mode 100644 index 000000000..ed59f4aaa --- /dev/null +++ b/src/models/jsonld/MenuSectionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MerchantReturnEnumerationInterface.php b/src/models/jsonld/MerchantReturnEnumerationInterface.php new file mode 100644 index 000000000..bd105c087 --- /dev/null +++ b/src/models/jsonld/MerchantReturnEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MerchantReturnFiniteReturnWindowInterface.php b/src/models/jsonld/MerchantReturnFiniteReturnWindowInterface.php new file mode 100644 index 000000000..8f9053b61 --- /dev/null +++ b/src/models/jsonld/MerchantReturnFiniteReturnWindowInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MerchantReturnNotPermittedInterface.php b/src/models/jsonld/MerchantReturnNotPermittedInterface.php new file mode 100644 index 000000000..73a86214a --- /dev/null +++ b/src/models/jsonld/MerchantReturnNotPermittedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'applicableCountry' => ['Text', 'Country'], + 'customerRemorseReturnFees' => ['ReturnFeesEnumeration'], + 'customerRemorseReturnLabelSource' => ['ReturnLabelSourceEnumeration'], + 'customerRemorseReturnShippingFeesAmount' => ['MonetaryAmount'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inStoreReturnsOffered' => ['Boolean'], + 'itemCondition' => ['OfferItemCondition'], + 'itemDefectReturnFees' => ['ReturnFeesEnumeration'], + 'itemDefectReturnLabelSource' => ['ReturnLabelSourceEnumeration'], + 'itemDefectReturnShippingFeesAmount' => ['MonetaryAmount'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'merchantReturnDays' => ['DateTime', 'Integer', 'Date'], + 'merchantReturnLink' => ['URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'refundType' => ['RefundTypeEnumeration'], + 'restockingFee' => ['MonetaryAmount', 'Number'], + 'returnFees' => ['ReturnFeesEnumeration'], + 'returnLabelSource' => ['ReturnLabelSourceEnumeration'], + 'returnMethod' => ['ReturnMethodEnumeration'], + 'returnPolicyCategory' => ['MerchantReturnEnumeration'], + 'returnPolicyCountry' => ['Country', 'Text'], + 'returnPolicySeasonalOverride' => ['MerchantReturnPolicySeasonalOverride'], + 'returnShippingFeesAmount' => ['MonetaryAmount'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'inStoreReturnsOffered', - 'merchantReturnDays', - 'merchantReturnLink', - 'refundType', - 'returnFees', - 'returnPolicyCategory' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'inStoreReturnsOffered' => ['Boolean'], - 'merchantReturnDays' => ['Integer'], - 'merchantReturnLink' => ['URL'], - 'refundType' => ['RefundTypeEnumeration'], - 'returnFees' => ['ReturnFeesEnumeration'], - 'returnPolicyCategory' => ['MerchantReturnEnumeration'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'inStoreReturnsOffered' => 'Are in-store returns offered?', - 'merchantReturnDays' => 'The merchantReturnDays property indicates the number of days (from purchase) within which relevant merchant return policy is applicable. Supersedes productReturnDays.', - 'merchantReturnLink' => 'Indicates a Web page or service by URL, for product return. Supersedes productReturnLink.', - 'refundType' => 'A refundType, from an enumerated list.', - 'returnFees' => 'Indicates (via enumerated options) the return fees policy for a MerchantReturnPolicy', - 'returnPolicyCategory' => 'A returnPolicyCategory expresses at most one of several enumerated kinds of return.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * Are in-store returns offered? - * - * @var bool [schema.org types: Boolean] + * @inheritdoc */ - public $inStoreReturnsOffered; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'applicableCountry' => 'A country where a particular merchant return policy applies to, for example the two-letter ISO 3166-1 alpha-2 country code.', + 'customerRemorseReturnFees' => 'The type of return fees if the product is returned due to customer remorse.', + 'customerRemorseReturnLabelSource' => 'The method (from an enumeration) by which the customer obtains a return shipping label for a product returned due to customer remorse.', + 'customerRemorseReturnShippingFeesAmount' => 'The amount of shipping costs if a product is returned due to customer remorse. Applicable when property [[customerRemorseReturnFees]] equals [[ReturnShippingFees]].', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inStoreReturnsOffered' => 'Are in-store returns offered? (for more advanced return methods use the [[returnMethod]] property)', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + 'itemDefectReturnFees' => 'The type of return fees for returns of defect products.', + 'itemDefectReturnLabelSource' => 'The method (from an enumeration) by which the customer obtains a return shipping label for a defect product.', + 'itemDefectReturnShippingFeesAmount' => 'Amount of shipping costs for defect product returns. Applicable when property [[itemDefectReturnFees]] equals [[ReturnShippingFees]].', + '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.', + 'merchantReturnDays' => 'Specifies either a fixed return date or the number of days (from the delivery date) that a product can be returned. Used when the [[returnPolicyCategory]] property is specified as [[MerchantReturnFiniteReturnWindow]].', + 'merchantReturnLink' => 'Specifies a Web page or service by URL, for product returns.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'refundType' => 'A refund type, from an enumerated list.', + 'restockingFee' => 'Use [[MonetaryAmount]] to specify a fixed restocking fee for product returns, or use [[Number]] to specify a percentage of the product price paid by the customer.', + 'returnFees' => 'The type of return fees for purchased products (for any return reason)', + 'returnLabelSource' => 'The method (from an enumeration) by which the customer obtains a return shipping label for a product returned for any reason.', + 'returnMethod' => 'The type of return method offered, specified from an enumeration.', + 'returnPolicyCategory' => 'Specifies an applicable return policy (from an enumeration).', + 'returnPolicyCountry' => 'The country where the product has to be sent to for returns, for example "Ireland" using the [[name]] property of [[Country]]. You can also provide the two-letter [ISO 3166-1 alpha-2 country code](http://en.wikipedia.org/wiki/ISO_3166-1). Note that this can be different from the country where the product was originally shipped from or sent too.', + 'returnPolicySeasonalOverride' => 'Seasonal override of a return policy.', + 'returnShippingFeesAmount' => 'Amount of shipping costs for product returns (for any reason). Applicable when property [[returnFees]] equals [[ReturnShippingFees]].', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The merchantReturnDays property indicates the number of days (from - * purchase) within which relevant merchant return policy is applicable. - * Supersedes productReturnDays. - * - * @var int [schema.org types: Integer] - */ - public $merchantReturnDays; /** - * Indicates a Web page or service by URL, for product return. Supersedes - * productReturnLink. - * - * @var string [schema.org types: URL] - */ - public $merchantReturnLink; - /** - * A refundType, from an enumerated list. - * - * @var RefundTypeEnumeration [schema.org types: RefundTypeEnumeration] - */ - public $refundType; - /** - * Indicates (via enumerated options) the return fees policy for a - * MerchantReturnPolicy - * - * @var ReturnFeesEnumeration [schema.org types: ReturnFeesEnumeration] - */ - public $returnFees; - /** - * A returnPolicyCategory expresses at most one of several enumerated kinds of - * return. - * - * @var MerchantReturnEnumeration [schema.org types: MerchantReturnEnumeration] + * @inheritdoc */ - public $returnPolicyCategory; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['inStoreReturnsOffered', 'merchantReturnDays', 'merchantReturnLink', 'refundType', 'returnFees', 'returnPolicyCategory'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MerchantReturnPolicyInterface.php b/src/models/jsonld/MerchantReturnPolicyInterface.php new file mode 100644 index 000000000..fbab71137 --- /dev/null +++ b/src/models/jsonld/MerchantReturnPolicyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endDate' => ['Date', 'DateTime'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'merchantReturnDays' => ['DateTime', 'Integer', 'Date'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'returnPolicyCategory' => ['MerchantReturnEnumeration'], + 'sameAs' => ['URL'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'merchantReturnDays' => 'Specifies either a fixed return date or the number of days (from the delivery date) that a product can be returned. Used when the [[returnPolicyCategory]] property is specified as [[MerchantReturnFiniteReturnWindow]].', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'returnPolicyCategory' => 'Specifies an applicable return policy (from an enumeration).', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/MerchantReturnPolicySeasonalOverrideInterface.php b/src/models/jsonld/MerchantReturnPolicySeasonalOverrideInterface.php new file mode 100644 index 000000000..3dc841c27 --- /dev/null +++ b/src/models/jsonld/MerchantReturnPolicySeasonalOverrideInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MerchantReturnUnlimitedWindowInterface.php b/src/models/jsonld/MerchantReturnUnlimitedWindowInterface.php new file mode 100644 index 000000000..97d741804 --- /dev/null +++ b/src/models/jsonld/MerchantReturnUnlimitedWindowInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MerchantReturnUnspecifiedInterface.php b/src/models/jsonld/MerchantReturnUnspecifiedInterface.php new file mode 100644 index 000000000..5449fb531 --- /dev/null +++ b/src/models/jsonld/MerchantReturnUnspecifiedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bccRecipient' => ['Person', 'ContactPoint', 'Organization'], + 'ccRecipient' => ['Person', 'Organization', 'ContactPoint'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dateRead' => ['Date', 'DateTime'], + 'dateReceived' => ['DateTime'], + 'dateSent' => ['DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'messageAttachment' => ['CreativeWork'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sender' => ['Person', 'Audience', 'Organization'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'toRecipient' => ['ContactPoint', 'Person', 'Audience', 'Organization'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bccRecipient', - 'ccRecipient', - 'dateRead', - 'dateReceived', - 'dateSent', - 'messageAttachment', - 'recipient', - 'sender', - 'toRecipient' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bccRecipient' => ['ContactPoint', 'Organization', 'Person'], - 'ccRecipient' => ['ContactPoint', 'Organization', 'Person'], - 'dateRead' => ['Date', 'DateTime'], - 'dateReceived' => ['DateTime'], - 'dateSent' => ['DateTime'], - 'messageAttachment' => ['CreativeWork'], - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'], - 'sender' => ['Audience', 'Organization', 'Person'], - 'toRecipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bccRecipient' => 'A sub property of recipient. The recipient blind copied on a message.', - 'ccRecipient' => 'A sub property of recipient. The recipient copied on a message.', - 'dateRead' => 'The date/time at which the message has been read by the recipient if a single recipient exists.', - 'dateReceived' => 'The date/time the message was received if a single recipient exists.', - 'dateSent' => 'The date/time at which the message was sent.', - 'messageAttachment' => 'A CreativeWork attached to the message.', - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', - 'sender' => 'A sub property of participant. The participant who is at the sending end of the action.', - 'toRecipient' => 'A sub property of recipient. The recipient who was directly sent the message.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of recipient. The recipient blind copied on a message. - * - * @var mixed|ContactPoint|Organization|Person [schema.org types: ContactPoint, Organization, Person] - */ - public $bccRecipient; - /** - * A sub property of recipient. The recipient copied on a message. - * - * @var mixed|ContactPoint|Organization|Person [schema.org types: ContactPoint, Organization, Person] - */ - public $ccRecipient; - /** - * The date/time at which the message has been read by the recipient if a - * single recipient exists. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateRead; - /** - * The date/time the message was received if a single recipient exists. - * - * @var DateTime [schema.org types: DateTime] + * @inheritdoc */ - public $dateReceived; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bccRecipient' => 'A sub property of recipient. The recipient blind copied on a message.', + 'ccRecipient' => 'A sub property of recipient. The recipient copied on a message.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dateRead' => 'The date/time at which the message has been read by the recipient if a single recipient exists.', + 'dateReceived' => 'The date/time the message was received if a single recipient exists.', + 'dateSent' => 'The date/time at which the message was sent.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'messageAttachment' => 'A CreativeWork attached to the message.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sender' => 'A sub property of participant. The participant who is at the sending end of the action.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'toRecipient' => 'A sub property of recipient. The recipient who was directly sent the message.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The date/time at which the message was sent. - * - * @var DateTime [schema.org types: DateTime] - */ - public $dateSent; - /** - * A CreativeWork attached to the message. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $messageAttachment; - /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] - */ - public $recipient; - /** - * A sub property of participant. The participant who is at the sending end of - * the action. - * - * @var mixed|Audience|Organization|Person [schema.org types: Audience, Organization, Person] - */ - public $sender; - /** - * A sub property of recipient. The recipient who was directly sent the - * message. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $toRecipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bccRecipient', 'ccRecipient', 'dateRead', 'dateReceived', 'dateSent', 'messageAttachment', 'recipient', 'sender', 'toRecipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MessageInterface.php b/src/models/jsonld/MessageInterface.php new file mode 100644 index 000000000..5d0f17d2c --- /dev/null +++ b/src/models/jsonld/MessageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'alumni' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'alumni' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $alumni; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['alumni'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MiddleSchoolInterface.php b/src/models/jsonld/MiddleSchoolInterface.php new file mode 100644 index 000000000..d80dd0d16 --- /dev/null +++ b/src/models/jsonld/MiddleSchoolInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MidwiferyInterface.php b/src/models/jsonld/MidwiferyInterface.php new file mode 100644 index 000000000..294a49082 --- /dev/null +++ b/src/models/jsonld/MidwiferyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/MinimumAdvertisedPriceInterface.php b/src/models/jsonld/MinimumAdvertisedPriceInterface.php new file mode 100644 index 000000000..c089bb462 --- /dev/null +++ b/src/models/jsonld/MinimumAdvertisedPriceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MisconceptionsHealthAspectInterface.php b/src/models/jsonld/MisconceptionsHealthAspectInterface.php new file mode 100644 index 000000000..830ad56ae --- /dev/null +++ b/src/models/jsonld/MisconceptionsHealthAspectInterface.php @@ -0,0 +1,24 @@ + ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] - */ - public $supersededBy; - - // Public Methods - // ========================================================================= - - /** - * @inheritdoc - */ - public function init(): void - { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); - } - - /** - * @inheritdoc - */ - public function rules(): array - { - $rules = parent::rules(); - $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] - ]); - - return $rules; - } -} diff --git a/src/models/jsonld/MixedEventAttendanceMode.php b/src/models/jsonld/MixedEventAttendanceMode.php index 33b7d39c9..c609f33d7 100644 --- a/src/models/jsonld/MixedEventAttendanceMode.php +++ b/src/models/jsonld/MixedEventAttendanceMode.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MixedEventAttendanceModeInterface.php b/src/models/jsonld/MixedEventAttendanceModeInterface.php new file mode 100644 index 000000000..fd46add1c --- /dev/null +++ b/src/models/jsonld/MixedEventAttendanceModeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MixtapeAlbumInterface.php b/src/models/jsonld/MixtapeAlbumInterface.php new file mode 100644 index 000000000..68410b40d --- /dev/null +++ b/src/models/jsonld/MixtapeAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'applicationCategory' => ['Text', 'URL'], + 'applicationSubCategory' => ['URL', 'Text'], + 'applicationSuite' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'availableOnDevice' => ['Text'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'carrierRequirements' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countriesNotSupported' => ['Text'], + 'countriesSupported' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'device' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'downloadUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'featureList' => ['Text', 'URL'], + 'fileFormat' => ['URL', 'Text'], + 'fileSize' => ['Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'installUrl' => ['URL'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'memoryRequirements' => ['Text', 'URL'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'operatingSystem' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'permissions' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'processorRequirements' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releaseNotes' => ['URL', 'Text'], + 'releasedEvent' => ['PublicationEvent'], + 'requirements' => ['URL', 'Text'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'screenshot' => ['ImageObject', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'softwareAddOn' => ['SoftwareApplication'], + 'softwareHelp' => ['CreativeWork'], + 'softwareRequirements' => ['URL', 'Text'], + 'softwareVersion' => ['Text'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'storageRequirements' => ['URL', 'Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supportingData' => ['DataFeed'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'carrierRequirements' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'applicationCategory' => 'Type of software application, e.g. \'Game, Multimedia\'.', + 'applicationSubCategory' => 'Subcategory of the application, e.g. \'Arcade Game\'.', + 'applicationSuite' => 'The name of the application suite to which the application belongs (e.g. Excel belongs to Office).', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'availableOnDevice' => 'Device required to run the application. Used in cases where a specific make/model is required to run the application.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'carrierRequirements' => 'Specifies specific carrier(s) requirements for the application (e.g. an application may only work on a specific carrier network).', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countriesNotSupported' => 'Countries for which the application is not supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', + 'countriesSupported' => 'Countries for which the application is supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + 'device' => 'Device required to run the application. Used in cases where a specific make/model is required to run the application.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'downloadUrl' => 'If the file can be downloaded, URL to download the binary.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'featureList' => 'Features or modules provided by this application (and possibly required by other applications).', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'fileSize' => 'Size of the application / package (e.g. 18MB). In the absence of a unit (MB, KB etc.), KB will be assumed.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'installUrl' => 'URL at which the app may be installed, if different from the URL of the item.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'memoryRequirements' => 'Minimum memory requirements.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'operatingSystem' => 'Operating systems supported (Windows 7, OSX 10.6, Android 1.6).', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'permissions' => 'Permission(s) required to run the app (for example, a mobile app may require full internet access or may run only on wifi).', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'processorRequirements' => 'Processor architecture required to run the application (e.g. IA64).', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releaseNotes' => 'Description of what changed in this version.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requirements' => 'Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime).', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'screenshot' => 'A link to a screenshot image of the app.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'softwareAddOn' => 'Additional content for a software application.', + 'softwareHelp' => 'Software application help.', + 'softwareRequirements' => 'Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime).', + 'softwareVersion' => 'Version of the software instance.', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'storageRequirements' => 'Storage requirements (free space required).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supportingData' => 'Supporting data for a SoftwareApplication.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'carrierRequirements' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'carrierRequirements' => 'Specifies specific carrier(s) requirements for the application (e.g. an application may only work on a specific carrier network).' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Specifies specific carrier(s) requirements for the application (e.g. an - * application may only work on a specific carrier network). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $carrierRequirements; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['carrierRequirements'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MobileApplicationInterface.php b/src/models/jsonld/MobileApplicationInterface.php new file mode 100644 index 000000000..3a0d55847 --- /dev/null +++ b/src/models/jsonld/MobileApplicationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MobilePhoneStoreInterface.php b/src/models/jsonld/MobilePhoneStoreInterface.php new file mode 100644 index 000000000..b8371a411 --- /dev/null +++ b/src/models/jsonld/MobilePhoneStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/MobileWebPlatformInterface.php b/src/models/jsonld/MobileWebPlatformInterface.php new file mode 100644 index 000000000..c9174a1ee --- /dev/null +++ b/src/models/jsonld/MobileWebPlatformInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedDisease' => ['URL', 'PropertyValue', 'MedicalCondition'], + 'bioChemInteraction' => ['BioChemEntity'], + 'bioChemSimilarity' => ['BioChemEntity'], + 'biologicalRole' => ['DefinedTerm'], + 'chemicalRole' => ['DefinedTerm'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'hasBioChemEntityPart' => ['BioChemEntity'], + 'hasMolecularFunction' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'hasRepresentation' => ['Text', 'PropertyValue', 'URL'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inChI' => ['Text'], + 'inChIKey' => ['Text'], + 'isEncodedByBioChemEntity' => ['Gene'], + 'isInvolvedInBiologicalProcess' => ['PropertyValue', 'URL', 'DefinedTerm'], + 'isLocatedInSubcellularLocation' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'isPartOfBioChemEntity' => ['BioChemEntity'], + 'iupacName' => ['Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'molecularFormula' => ['Text'], + 'molecularWeight' => ['QuantitativeValue', 'Text'], + 'monoisotopicMolecularWeight' => ['Text', 'QuantitativeValue'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'potentialUse' => ['DefinedTerm'], + 'sameAs' => ['URL'], + 'smiles' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxonomicRange' => ['URL', 'DefinedTerm', 'Text', 'Taxon'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + '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.', + 'bioChemInteraction' => 'A BioChemEntity that is known to interact with this item.', + 'bioChemSimilarity' => 'A similar BioChemEntity, e.g., obtained by fingerprint similarity algorithms.', + 'biologicalRole' => 'A role played by the BioChemEntity within a biological context.', + 'chemicalRole' => 'A role played by the BioChemEntity within a chemical context.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'hasBioChemEntityPart' => 'Indicates a BioChemEntity that (in some sense) has this BioChemEntity as a part. ', + 'hasMolecularFunction' => 'Molecular function performed by this BioChemEntity; please use PropertyValue if you want to include any evidence.', + 'hasRepresentation' => 'A common representation such as a protein sequence or chemical structure for this entity. For images use schema.org/image.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inChI' => 'Non-proprietary identifier for molecular entity that can be used in printed and electronic data sources thus enabling easier linking of diverse data compilations.', + 'inChIKey' => 'InChIKey is a hashed version of the full InChI (using the SHA-256 algorithm).', + 'isEncodedByBioChemEntity' => 'Another BioChemEntity encoding by this one.', + 'isInvolvedInBiologicalProcess' => 'Biological process this BioChemEntity is involved in; please use PropertyValue if you want to include any evidence.', + 'isLocatedInSubcellularLocation' => 'Subcellular location where this BioChemEntity is located; please use PropertyValue if you want to include any evidence.', + 'isPartOfBioChemEntity' => 'Indicates a BioChemEntity that is (in some sense) a part of this BioChemEntity. ', + 'iupacName' => 'Systematic method of naming chemical compounds as recommended by the International Union of Pure and Applied Chemistry (IUPAC).', + '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.', + 'molecularFormula' => 'The empirical formula is the simplest whole number ratio of all the atoms in a molecule.', + 'molecularWeight' => 'This is the molecular weight of the entity being described, not of the parent. Units should be included in the form \' \', for example \'12 amu\' or as \'.', + 'monoisotopicMolecularWeight' => 'The monoisotopic mass is the sum of the masses of the atoms in a molecule using the unbound, ground-state, rest mass of the principal (most abundant) isotope for each element instead of the isotopic average mass. Please include the units the form \' \', for example \'770.230488 g/mol\' or as \'.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'potentialUse' => 'Intended use of the BioChemEntity by humans.', + '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.', + 'smiles' => 'A specification in form of a line notation for describing the structure of chemical species using short ASCII strings. Double bond stereochemistry \ indicators may need to be escaped in the string in formats where the backslash is an escape character.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxonomicRange' => 'The taxonomic grouping of the organism that expresses, encodes, or in someway related to the BioChemEntity.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/MolecularEntityInterface.php b/src/models/jsonld/MolecularEntityInterface.php new file mode 100644 index 000000000..6d6e3c2af --- /dev/null +++ b/src/models/jsonld/MolecularEntityInterface.php @@ -0,0 +1,24 @@ + ', for example '770.230488 + * g/mol' or as '. + * + * @var string|Text|QuantitativeValue + */ + public $monoisotopicMolecularWeight; + + /** + * The empirical formula is the simplest whole number ratio of all the atoms + * in a molecule. + * + * @var string|Text + */ + public $molecularFormula; + + /** + * Intended use of the BioChemEntity by humans. + * + * @var DefinedTerm + */ + public $potentialUse; + + /** + * A role played by the BioChemEntity within a chemical context. + * + * @var DefinedTerm + */ + public $chemicalRole; + + /** + * This is the molecular weight of the entity being described, not of the + * parent. Units should be included in the form ' ', for example + * '12 amu' or as '. + * + * @var string|QuantitativeValue|Text + */ + public $molecularWeight; + + /** + * Non-proprietary identifier for molecular entity that can be used in printed + * and electronic data sources thus enabling easier linking of diverse data + * compilations. + * + * @var string|Text + */ + public $inChI; + + /** + * A specification in form of a line notation for describing the structure of + * chemical species using short ASCII strings. Double bond stereochemistry \ + * indicators may need to be escaped in the string in formats where the + * backslash is an escape character. + * + * @var string|Text + */ + public $smiles; + +} diff --git a/src/models/jsonld/Monday.php b/src/models/jsonld/Monday.php index f5bd1cca1..20e77cab8 100644 --- a/src/models/jsonld/Monday.php +++ b/src/models/jsonld/Monday.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MondayInterface.php b/src/models/jsonld/MondayInterface.php new file mode 100644 index 000000000..b6e3f5641 --- /dev/null +++ b/src/models/jsonld/MondayInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'currency' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxValue' => ['Number'], + 'minValue' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'value' => ['Text', 'Number', 'StructuredValue', 'Boolean'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currency', - 'maxValue', - 'minValue', - 'validFrom', - 'validThrough', - 'value' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currency' => ['Text'], - 'maxValue' => ['Number'], - 'minValue' => ['Number'], - 'validFrom' => ['Date', 'DateTime'], - 'validThrough' => ['Date', 'DateTime'], - 'value' => ['Boolean', 'Number', 'StructuredValue', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currency' => 'The currency in which the monetary amount is expressed. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'maxValue' => 'The upper value of some characteristic or property.', - 'minValue' => 'The lower value of some characteristic or property.', - 'validFrom' => 'The date when the item becomes valid.', - 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', - 'value' => 'The value of the quantitative value or property value node. For QuantitativeValue and MonetaryAmount, the recommended type for values is \'Number\'. For PropertyValue, it can be \'Text;\', \'Number\', \'Boolean\', or \'StructuredValue\'. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The currency in which the monetary amount is expressed. Use standard - * formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for - * cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings - * Systems (LETS) and other currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $currency; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'currency' => 'The currency in which the monetary amount is expressed. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maxValue' => 'The upper value of some characteristic or property.', + 'minValue' => 'The lower value of some characteristic or property.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'value' => 'The value of the quantitative value or property value node. * For [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type for values is \'Number\'. * For [[PropertyValue]], it can be \'Text;\', \'Number\', \'Boolean\', or \'StructuredValue\'. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The upper value of some characteristic or property. - * - * @var float [schema.org types: Number] - */ - public $maxValue; /** - * The lower value of some characteristic or property. - * - * @var float [schema.org types: Number] - */ - public $minValue; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; - /** - * The date after when the item is not valid. For example the end of an offer, - * salary period, or a period of opening hours. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validThrough; - /** - * The value of the quantitative value or property value node. For - * QuantitativeValue and MonetaryAmount, the recommended type for values is - * 'Number'. For PropertyValue, it can be 'Text;', 'Number', 'Boolean', or - * 'StructuredValue'. Use values from 0123456789 (Unicode 'DIGIT ZERO' - * (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar - * Unicode symbols. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to - * indicate a decimal point. Avoid using these symbols as a readability - * separator. - * - * @var mixed|bool|float|StructuredValue|string [schema.org types: Boolean, Number, StructuredValue, Text] + * @inheritdoc */ - public $value; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currency', 'maxValue', 'minValue', 'validFrom', 'validThrough', 'value'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MonetaryAmountDistribution.php b/src/models/jsonld/MonetaryAmountDistribution.php index 51b436b38..50483e8e0 100644 --- a/src/models/jsonld/MonetaryAmountDistribution.php +++ b/src/models/jsonld/MonetaryAmountDistribution.php @@ -1,28 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'currency' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'duration' => ['Duration'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'median' => ['Number'], + 'name' => ['Text'], + 'percentile10' => ['Number'], + 'percentile25' => ['Number'], + 'percentile75' => ['Number'], + 'percentile90' => ['Number'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'currency' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'currency' => 'The currency in which the monetary amount is expressed. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'description' => 'A description of the item.', + '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.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'median' => 'The median value.', + 'name' => 'The name of the item.', + 'percentile10' => 'The 10th percentile value.', + 'percentile25' => 'The 25th percentile value.', + 'percentile75' => 'The 75th percentile value.', + 'percentile90' => 'The 90th percentile value.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currency' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currency' => 'The currency in which the monetary amount is expressed. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency in which the monetary amount is expressed. Use standard - * formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for - * cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings - * Systems (LETS) and other currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $currency; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currency'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MonetaryAmountDistributionInterface.php b/src/models/jsonld/MonetaryAmountDistributionInterface.php new file mode 100644 index 000000000..783761ab0 --- /dev/null +++ b/src/models/jsonld/MonetaryAmountDistributionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'fundedItem' => ['Product', 'Person', 'BioChemEntity', 'Event', 'MedicalEntity', 'CreativeWork', 'Organization'], + 'funder' => ['Organization', 'Person'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amount', - 'funder' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'amount' => ['MonetaryAmount', 'Number'], - 'funder' => ['Organization', 'Person'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'description' => 'A description of the item.', + '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.', + 'fundedItem' => 'Indicates something directly or indirectly funded or sponsored through a [[Grant]]. See also [[ownershipFundingInfo]].', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amount' => 'The amount of money.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The amount of money. - * - * @var mixed|MonetaryAmount|float [schema.org types: MonetaryAmount, Number] - */ - public $amount; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $funder; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amount', 'funder'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MonetaryGrantInterface.php b/src/models/jsonld/MonetaryGrantInterface.php new file mode 100644 index 000000000..ce6b34fb2 --- /dev/null +++ b/src/models/jsonld/MonetaryGrantInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'beneficiaryBank' => ['BankOrCreditUnion', 'Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amount', - 'beneficiaryBank' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'amount' => ['MonetaryAmount', 'Number'], - 'beneficiaryBank' => ['BankOrCreditUnion', 'Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'beneficiaryBank' => 'A bank or bank’s branch, financial institution or international financial institution operating the beneficiary’s bank account or releasing funds for the beneficiary.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amount' => 'The amount of money.', - 'beneficiaryBank' => 'A bank or bank’s branch, financial institution or international financial institution operating the beneficiary’s bank account or releasing funds for the beneficiary' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The amount of money. - * - * @var mixed|MonetaryAmount|float [schema.org types: MonetaryAmount, Number] - */ - public $amount; - /** - * A bank or bank’s branch, financial institution or international financial - * institution operating the beneficiary’s bank account or releasing funds - * for the beneficiary - * - * @var mixed|BankOrCreditUnion|string [schema.org types: BankOrCreditUnion, Text] + * @inheritdoc */ - public $beneficiaryBank; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amount', 'beneficiaryBank'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MoneyTransferInterface.php b/src/models/jsonld/MoneyTransferInterface.php new file mode 100644 index 000000000..2f3d8d124 --- /dev/null +++ b/src/models/jsonld/MoneyTransferInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amount' => ['Number', 'MonetaryAmount'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'currency' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'domiciledMortgage' => ['Boolean'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'gracePeriod' => ['Duration'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'loanMortgageMandateAmount' => ['MonetaryAmount'], + 'loanRepaymentForm' => ['RepaymentSpecification'], + 'loanTerm' => ['QuantitativeValue'], + 'loanType' => ['URL', 'Text'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'recourseLoan' => ['Boolean'], + 'renegotiableLoan' => ['Boolean'], + 'requiredCollateral' => ['Text', 'Thing'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'domiciledMortgage', - 'loanMortgageMandateAmount' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'domiciledMortgage' => ['Boolean'], - 'loanMortgageMandateAmount' => ['MonetaryAmount'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amount' => 'The amount of money.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'currency' => 'The currency in which the monetary amount is expressed. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'description' => 'A description of the item.', + '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.', + 'domiciledMortgage' => 'Whether borrower is a resident of the jurisdiction where the property is located.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'gracePeriod' => 'The period of time after any due date that the borrower has to fulfil its obligations before a default (failure to pay) is deemed to have occurred.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'loanMortgageMandateAmount' => 'Amount of mortgage mandate that can be converted into a proper mortgage at a later stage.', + 'loanRepaymentForm' => 'A form of paying back money previously borrowed from a lender. Repayment usually takes the form of periodic payments that normally include part principal plus interest in each payment.', + 'loanTerm' => 'The duration of the loan or credit agreement.', + 'loanType' => 'The type of a loan or credit.', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'recourseLoan' => 'The only way you get the money back in the event of default is the security. Recourse is where you still have the opportunity to go back to the borrower for the rest of the money.', + 'renegotiableLoan' => 'Whether the terms for payment of interest can be renegotiated during the life of the loan.', + 'requiredCollateral' => 'Assets required to secure loan or credit repayments. It may take form of third party pledge, goods, financial instruments (cash, securities, etc.)', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'domiciledMortgage' => 'Whether borrower is a resident of the jurisdiction where the property is located.', - 'loanMortgageMandateAmount' => 'Amount of mortgage mandate that can be converted into a proper mortgage at a later stage.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Whether borrower is a resident of the jurisdiction where the property is - * located. - * - * @var bool [schema.org types: Boolean] - */ - public $domiciledMortgage; - /** - * Amount of mortgage mandate that can be converted into a proper mortgage at - * a later stage. - * - * @var MonetaryAmount [schema.org types: MonetaryAmount] + * @inheritdoc */ - public $loanMortgageMandateAmount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['domiciledMortgage', 'loanMortgageMandateAmount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MortgageLoanInterface.php b/src/models/jsonld/MortgageLoanInterface.php new file mode 100644 index 000000000..9e020e7c6 --- /dev/null +++ b/src/models/jsonld/MortgageLoanInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MosqueInterface.php b/src/models/jsonld/MosqueInterface.php new file mode 100644 index 000000000..f5da53877 --- /dev/null +++ b/src/models/jsonld/MosqueInterface.php @@ -0,0 +1,24 @@ +dedicated document on + * the use of schema.org for marking up hotels and other forms of + * accommodations. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Motel + * @see https://schema.org/Motel */ -class Motel extends LodgingBusiness +class Motel extends MetaJsonLd implements MotelInterface, LodgingBusinessInterface, LocalBusinessInterface, OrganizationInterface, ThingInterface, PlaceInterface { // Static Public Properties // ========================================================================= @@ -32,235 +33,339 @@ class Motel extends LodgingBusiness * * @var string */ - static public $schemaTypeName = 'Motel'; + static public string $schemaTypeName = 'Motel'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Motel'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'A motel. See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/Motel'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'LodgingBusiness'; + static public string $schemaTypeExtends = 'LodgingBusiness'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<
+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use MotelTrait; + use LodgingBusinessTrait; + use LocalBusinessTrait; + use OrganizationTrait; + use ThingTrait; + use PlaceTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableLanguage' => ['Text', 'Language'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'checkinTime' => ['DateTime', 'Time'], + 'checkoutTime' => ['DateTime', 'Time'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amenityFeature', - 'audience', - 'availableLanguage', - 'checkinTime', - 'checkoutTime', - 'numberOfRooms', - 'petsAllowed', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amenityFeature' => ['LocationFeatureSpecification'], - 'audience' => ['Audience'], - 'availableLanguage' => ['Language', 'Text'], - 'checkinTime' => ['DateTime', 'Time'], - 'checkoutTime' => ['DateTime', 'Time'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'petsAllowed' => ['Boolean', 'Text'], - 'starRating' => ['Rating'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. See also inLanguage', - 'checkinTime' => 'The earliest someone may check into a lodging establishment.', - 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A language someone may use with or at the item, service or place. Please - * use one of the language codes from the IETF BCP 47 standard. See also - * inLanguage - * - * @var mixed|Language|string [schema.org types: Language, Text] + * @inheritdoc */ - public $availableLanguage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'checkinTime' => 'The earliest someone may check into a lodging establishment.', + 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The earliest someone may check into a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkinTime; - /** - * The latest someone may check out of a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkoutTime; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; - /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amenityFeature', 'audience', 'availableLanguage', 'checkinTime', 'checkoutTime', 'numberOfRooms', 'petsAllowed', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MotelInterface.php b/src/models/jsonld/MotelInterface.php new file mode 100644 index 000000000..904f7c3a9 --- /dev/null +++ b/src/models/jsonld/MotelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accelerationTime' => ['QuantitativeValue'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bodyType' => ['QualitativeValue', 'Text', 'URL'], + 'brand' => ['Organization', 'Brand'], + 'callSign' => ['Text'], + 'cargoVolume' => ['QuantitativeValue'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'dateVehicleFirstRegistered' => ['Date'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'driveWheelConfiguration' => ['Text', 'DriveWheelConfigurationValue'], + 'emissionsCO2' => ['Number'], + 'fuelCapacity' => ['QuantitativeValue'], + 'fuelConsumption' => ['QuantitativeValue'], + 'fuelEfficiency' => ['QuantitativeValue'], + 'fuelType' => ['Text', 'URL', 'QualitativeValue'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knownVehicleDamages' => ['Text'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'meetsEmissionStandard' => ['Text', 'URL', 'QualitativeValue'], + 'mileageFromOdometer' => ['QuantitativeValue'], + 'model' => ['ProductModel', 'Text'], + 'modelDate' => ['Date'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'numberOfAirbags' => ['Text', 'Number'], + 'numberOfAxles' => ['Number', 'QuantitativeValue'], + 'numberOfDoors' => ['QuantitativeValue', 'Number'], + 'numberOfForwardGears' => ['QuantitativeValue', 'Number'], + 'numberOfPreviousOwners' => ['Number', 'QuantitativeValue'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'payload' => ['QuantitativeValue'], + 'potentialAction' => ['Action'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seatingCapacity' => ['QuantitativeValue', 'Number'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'speed' => ['QuantitativeValue'], + 'steeringPosition' => ['SteeringPositionValue'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'tongueWeight' => ['QuantitativeValue'], + 'trailerWeight' => ['QuantitativeValue'], + 'url' => ['URL'], + 'vehicleConfiguration' => ['Text'], + 'vehicleEngine' => ['EngineSpecification'], + 'vehicleIdentificationNumber' => ['Text'], + 'vehicleInteriorColor' => ['Text'], + 'vehicleInteriorType' => ['Text'], + 'vehicleModelDate' => ['Date'], + 'vehicleSeatingCapacity' => ['QuantitativeValue', 'Number'], + 'vehicleSpecialUsage' => ['CarUsageType', 'Text'], + 'vehicleTransmission' => ['Text', 'QualitativeValue', 'URL'], + 'weight' => ['QuantitativeValue'], + 'weightTotal' => ['QuantitativeValue'], + 'wheelbase' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accelerationTime', - 'bodyType', - 'callSign', - 'cargoVolume', - 'dateVehicleFirstRegistered', - 'driveWheelConfiguration', - 'emissionsCO2', - 'fuelCapacity', - 'fuelConsumption', - 'fuelEfficiency', - 'fuelType', - 'knownVehicleDamages', - 'meetsEmissionStandard', - 'mileageFromOdometer', - 'modelDate', - 'numberOfAirbags', - 'numberOfAxles', - 'numberOfDoors', - 'numberOfForwardGears', - 'numberOfPreviousOwners', - 'payload', - 'productionDate', - 'purchaseDate', - 'seatingCapacity', - 'speed', - 'steeringPosition', - 'tongueWeight', - 'trailerWeight', - 'vehicleConfiguration', - 'vehicleEngine', - 'vehicleIdentificationNumber', - 'vehicleInteriorColor', - 'vehicleInteriorType', - 'vehicleModelDate', - 'vehicleSeatingCapacity', - 'vehicleSpecialUsage', - 'vehicleTransmission', - 'weightTotal', - 'wheelbase' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accelerationTime' => ['QuantitativeValue'], - 'bodyType' => ['QualitativeValue', 'Text', 'URL'], - 'callSign' => ['Text'], - 'cargoVolume' => ['QuantitativeValue'], - 'dateVehicleFirstRegistered' => ['Date'], - 'driveWheelConfiguration' => ['DriveWheelConfigurationValue', 'Text'], - 'emissionsCO2' => ['Number'], - 'fuelCapacity' => ['QuantitativeValue'], - 'fuelConsumption' => ['QuantitativeValue'], - 'fuelEfficiency' => ['QuantitativeValue'], - 'fuelType' => ['QualitativeValue', 'Text', 'URL'], - 'knownVehicleDamages' => ['Text'], - 'meetsEmissionStandard' => ['QualitativeValue', 'Text', 'URL'], - 'mileageFromOdometer' => ['QuantitativeValue'], - 'modelDate' => ['Date'], - 'numberOfAirbags' => ['Number', 'Text'], - 'numberOfAxles' => ['Number', 'QuantitativeValue'], - 'numberOfDoors' => ['Number', 'QuantitativeValue'], - 'numberOfForwardGears' => ['Number', 'QuantitativeValue'], - 'numberOfPreviousOwners' => ['Number', 'QuantitativeValue'], - 'payload' => ['QuantitativeValue'], - 'productionDate' => ['Date'], - 'purchaseDate' => ['Date'], - 'seatingCapacity' => ['Number', 'QuantitativeValue'], - 'speed' => ['QuantitativeValue'], - 'steeringPosition' => ['SteeringPositionValue'], - 'tongueWeight' => ['QuantitativeValue'], - 'trailerWeight' => ['QuantitativeValue'], - 'vehicleConfiguration' => ['Text'], - 'vehicleEngine' => ['EngineSpecification'], - 'vehicleIdentificationNumber' => ['Text'], - 'vehicleInteriorColor' => ['Text'], - 'vehicleInteriorType' => ['Text'], - 'vehicleModelDate' => ['Date'], - 'vehicleSeatingCapacity' => ['Number', 'QuantitativeValue'], - 'vehicleSpecialUsage' => ['CarUsageType', 'Text'], - 'vehicleTransmission' => ['QualitativeValue', 'Text', 'URL'], - 'weightTotal' => ['QuantitativeValue'], - 'wheelbase' => ['QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accelerationTime' => 'The time needed to accelerate the vehicle from a given start velocity to a given target velocity. Typical unit code(s): SEC for seconds Note: There are unfortunately no standard unit codes for seconds/0..100 km/h or seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities in the name of the QuantitativeValue, or use valueReference with a QuantitativeValue of 0..60 mph or 0..100 km/h to specify the reference speeds.', - 'bodyType' => 'Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).', - 'callSign' => 'A callsign, as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', - 'cargoVolume' => 'The available volume for cargo or luggage. For automobiles, this is usually the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic foot/feet Note: You can use minValue and maxValue to indicate ranges.', - 'dateVehicleFirstRegistered' => 'The date of the first registration of the vehicle with the respective public authorities.', - 'driveWheelConfiguration' => 'The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle\'s engine via the drivetrain.', - 'emissionsCO2' => 'The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put "g/km" into the unitText property of that value, since there is no UN/CEFACT Common Code for "g/km".', - 'fuelCapacity' => 'The capacity of the fuel tank or in the case of electric cars, the battery. If there are multiple components for storage, this should indicate the total of all storage of the same type. Typical unit code(s): LTR for liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for ampere-hours (for electrical vehicles).', - 'fuelConsumption' => 'The amount of fuel consumed for traveling a particular distance or temporal duration with the given vehicle (e.g. liters per 100 km). Note 1: There are unfortunately no standard unit codes for liters per 100 km. Use unitText to indicate the unit of measurement, e.g. L/100 km. Note 2: There are two ways of indicating the fuel consumption, fuelConsumption (e.g. 8 liters per 100 km) and fuelEfficiency (e.g. 30 miles per gallon). They are reciprocal. Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use valueReference to link the value for the fuel consumption to another value.', - 'fuelEfficiency' => 'The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers per liter (km/L). Note 1: There are unfortunately no standard unit codes for miles per gallon or kilometers per liter. Use unitText to indicate the unit of measurement, e.g. mpg or km/L. Note 2: There are two ways of indicating the fuel consumption, fuelConsumption (e.g. 8 liters per 100 km) and fuelEfficiency (e.g. 30 miles per gallon). They are reciprocal. Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use valueReference to link the value for the fuel economy to another value.', - 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', - 'knownVehicleDamages' => 'A textual description of known damages, both repaired and unrepaired.', - 'meetsEmissionStandard' => 'Indicates that the vehicle meets the respective emission standard.', - 'mileageFromOdometer' => 'The total distance travelled by the particular vehicle since its initial production, as read from its odometer. Typical unit code(s): KMT for kilometers, SMI for statute miles', - 'modelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', - 'numberOfAirbags' => 'The number or type of airbags in the vehicle.', - 'numberOfAxles' => 'The number of axles. Typical unit code(s): C62', - 'numberOfDoors' => 'The number of doors. Typical unit code(s): C62', - 'numberOfForwardGears' => 'The total number of forward gears available for the transmission system of the vehicle. Typical unit code(s): C62', - 'numberOfPreviousOwners' => 'The number of owners of the vehicle, including the current one. Typical unit code(s): C62', - 'payload' => 'The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note 1: Many databases specify the permitted TOTAL weight instead, which is the sum of weight and payload Note 2: You can indicate additional information in the name of the QuantitativeValue node. Note 3: You may also link to a QualitativeValue node that provides additional information using valueReference. Note 4: Note that you can use minValue and maxValue to indicate ranges.', - 'productionDate' => 'The date of production of the item, e.g. vehicle.', - 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', - 'seatingCapacity' => 'The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons', - 'speed' => 'The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit of the speed range (indicated by maxValue should be the maximum speed achievable under regular conditions. Typical unit code(s): KMH for km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use minValue and maxValue to indicate the range. Typically, the minimal value is zero. * Note 2: There are many different ways of measuring the speed range. You can link to information about how the given value has been determined using the valueReference property.', - 'steeringPosition' => 'The position of the steering wheel or similar device (mostly for cars).', - 'tongueWeight' => 'The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can indicate additional information in the name of the QuantitativeValue node. Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference. Note 3: Note that you can use minValue and maxValue to indicate ranges.', - 'trailerWeight' => 'The permitted weight of a trailer attached to the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the name of the QuantitativeValue node. * Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference. * Note 3: Note that you can use minValue and maxValue to indicate ranges.', - 'vehicleConfiguration' => 'A short text indicating the configuration of the vehicle, e.g. \'5dr hatchback ST 2.5 MT 225 hp\' or \'limited edition\'.', - 'vehicleEngine' => 'Information about the engine or engines of the vehicle.', - 'vehicleIdentificationNumber' => 'The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles.', - 'vehicleInteriorColor' => 'The color or color combination of the interior of the vehicle.', - 'vehicleInteriorType' => 'The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.). While most interior types are characterized by the material used, an interior type can also be based on vehicle usage or target audience.', - 'vehicleModelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', - 'vehicleSeatingCapacity' => 'The number of passengers that can be seated in the vehicle, both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons.', - 'vehicleSpecialUsage' => 'Indicates whether the vehicle has been used for special purposes, like commercial rental, driving school, or as a taxi. The legislation in many countries requires this information to be revealed when offering a car for sale.', - 'vehicleTransmission' => 'The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars).', - 'weightTotal' => 'The permitted total weight of the loaded vehicle, including passengers and cargo and the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can indicate additional information in the name of the QuantitativeValue node. Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference. Note 3: Note that you can use minValue and maxValue to indicate ranges.', - 'wheelbase' => 'The distance between the centers of the front and rear wheels. Typical unit code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The time needed to accelerate the vehicle from a given start velocity to a - * given target velocity. Typical unit code(s): SEC for seconds Note: There - * are unfortunately no standard unit codes for seconds/0..100 km/h or - * seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities - * in the name of the QuantitativeValue, or use valueReference with a - * QuantitativeValue of 0..60 mph or 0..100 km/h to specify the reference - * speeds. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $accelerationTime; /** - * Indicates the design and body style of the vehicle (e.g. station wagon, - * hatchback, etc.). - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $bodyType; - /** - * A callsign, as used in broadcasting and radio communications to identify - * people, radio and TV stations, or vehicles. - * - * @var string [schema.org types: Text] - */ - public $callSign; - /** - * The available volume for cargo or luggage. For automobiles, this is usually - * the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic - * foot/feet Note: You can use minValue and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $cargoVolume; - /** - * The date of the first registration of the vehicle with the respective - * public authorities. - * - * @var Date [schema.org types: Date] - */ - public $dateVehicleFirstRegistered; - /** - * The drive wheel configuration, i.e. which roadwheels will receive torque - * from the vehicle's engine via the drivetrain. - * - * @var mixed|DriveWheelConfigurationValue|string [schema.org types: DriveWheelConfigurationValue, Text] - */ - public $driveWheelConfiguration; - /** - * The CO2 emissions in g/km. When used in combination with a - * QuantitativeValue, put "g/km" into the unitText property of that value, - * since there is no UN/CEFACT Common Code for "g/km". - * - * @var float [schema.org types: Number] - */ - public $emissionsCO2; - /** - * The capacity of the fuel tank or in the case of electric cars, the battery. - * If there are multiple components for storage, this should indicate the - * total of all storage of the same type. Typical unit code(s): LTR for - * liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for - * ampere-hours (for electrical vehicles). - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $fuelCapacity; - /** - * The amount of fuel consumed for traveling a particular distance or temporal - * duration with the given vehicle (e.g. liters per 100 km). Note 1: There are - * unfortunately no standard unit codes for liters per 100 km. Use unitText to - * indicate the unit of measurement, e.g. L/100 km. Note 2: There are two ways - * of indicating the fuel consumption, fuelConsumption (e.g. 8 liters per 100 - * km) and fuelEfficiency (e.g. 30 miles per gallon). They are reciprocal. - * Note 3: Often, the absolute value is useful only when related to driving - * speed ("at 80 km/h") or usage pattern ("city traffic"). You can use - * valueReference to link the value for the fuel consumption to another value. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $fuelConsumption; - /** - * The distance traveled per unit of fuel used; most commonly miles per gallon - * (mpg) or kilometers per liter (km/L). Note 1: There are unfortunately no - * standard unit codes for miles per gallon or kilometers per liter. Use - * unitText to indicate the unit of measurement, e.g. mpg or km/L. Note 2: - * There are two ways of indicating the fuel consumption, fuelConsumption - * (e.g. 8 liters per 100 km) and fuelEfficiency (e.g. 30 miles per gallon). - * They are reciprocal. Note 3: Often, the absolute value is useful only when - * related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). - * You can use valueReference to link the value for the fuel economy to - * another value. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $fuelEfficiency; - /** - * The type of fuel suitable for the engine or engines of the vehicle. If the - * vehicle has only one engine, this property can be attached directly to the - * vehicle. - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $fuelType; - /** - * A textual description of known damages, both repaired and unrepaired. - * - * @var string [schema.org types: Text] - */ - public $knownVehicleDamages; - /** - * Indicates that the vehicle meets the respective emission standard. - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $meetsEmissionStandard; - /** - * The total distance travelled by the particular vehicle since its initial - * production, as read from its odometer. Typical unit code(s): KMT for - * kilometers, SMI for statute miles - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $mileageFromOdometer; - /** - * The release date of a vehicle model (often used to differentiate versions - * of the same make and model). - * - * @var Date [schema.org types: Date] - */ - public $modelDate; - /** - * The number or type of airbags in the vehicle. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $numberOfAirbags; - /** - * The number of axles. Typical unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfAxles; - /** - * The number of doors. Typical unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfDoors; - /** - * The total number of forward gears available for the transmission system of - * the vehicle. Typical unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfForwardGears; - /** - * The number of owners of the vehicle, including the current one. Typical - * unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfPreviousOwners; - /** - * The permitted weight of passengers and cargo, EXCLUDING the weight of the - * empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note - * 1: Many databases specify the permitted TOTAL weight instead, which is the - * sum of weight and payload Note 2: You can indicate additional information - * in the name of the QuantitativeValue node. Note 3: You may also link to a - * QualitativeValue node that provides additional information using - * valueReference. Note 4: Note that you can use minValue and maxValue to - * indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $payload; - /** - * The date of production of the item, e.g. vehicle. - * - * @var Date [schema.org types: Date] - */ - public $productionDate; - /** - * The date the item e.g. vehicle was purchased by the current owner. - * - * @var Date [schema.org types: Date] - */ - public $purchaseDate; - /** - * The number of persons that can be seated (e.g. in a vehicle), both in terms - * of the physical space available, and in terms of limitations set by law. - * Typical unit code(s): C62 for persons - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $seatingCapacity; - /** - * The speed range of the vehicle. If the vehicle is powered by an engine, the - * upper limit of the speed range (indicated by maxValue should be the maximum - * speed achievable under regular conditions. Typical unit code(s): KMH for - * km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use - * minValue and maxValue to indicate the range. Typically, the minimal value - * is zero. * Note 2: There are many different ways of measuring the speed - * range. You can link to information about how the given value has been - * determined using the valueReference property. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $speed; - /** - * The position of the steering wheel or similar device (mostly for cars). - * - * @var SteeringPositionValue [schema.org types: SteeringPositionValue] - */ - public $steeringPosition; - /** - * The permitted vertical load (TWR) of a trailer attached to the vehicle. - * Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) - * Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can - * indicate additional information in the name of the QuantitativeValue node. - * Note 2: You may also link to a QualitativeValue node that provides - * additional information using valueReference. Note 3: Note that you can use - * minValue and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $tongueWeight; - /** - * The permitted weight of a trailer attached to the vehicle. Typical unit - * code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate - * additional information in the name of the QuantitativeValue node. * Note 2: - * You may also link to a QualitativeValue node that provides additional - * information using valueReference. * Note 3: Note that you can use minValue - * and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $trailerWeight; - /** - * A short text indicating the configuration of the vehicle, e.g. '5dr - * hatchback ST 2.5 MT 225 hp' or 'limited edition'. - * - * @var string [schema.org types: Text] - */ - public $vehicleConfiguration; - /** - * Information about the engine or engines of the vehicle. - * - * @var EngineSpecification [schema.org types: EngineSpecification] - */ - public $vehicleEngine; - /** - * The Vehicle Identification Number (VIN) is a unique serial number used by - * the automotive industry to identify individual motor vehicles. - * - * @var string [schema.org types: Text] - */ - public $vehicleIdentificationNumber; - /** - * The color or color combination of the interior of the vehicle. - * - * @var string [schema.org types: Text] - */ - public $vehicleInteriorColor; - /** - * The type or material of the interior of the vehicle (e.g. synthetic fabric, - * leather, wood, etc.). While most interior types are characterized by the - * material used, an interior type can also be based on vehicle usage or - * target audience. - * - * @var string [schema.org types: Text] - */ - public $vehicleInteriorType; - /** - * The release date of a vehicle model (often used to differentiate versions - * of the same make and model). - * - * @var Date [schema.org types: Date] + * @inheritdoc */ - public $vehicleModelDate; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accelerationTime' => 'The time needed to accelerate the vehicle from a given start velocity to a given target velocity. Typical unit code(s): SEC for seconds * Note: There are unfortunately no standard unit codes for seconds/0..100 km/h or seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities in the [[name]] of the [[QuantitativeValue]], or use [[valueReference]] with a [[QuantitativeValue]] of 0..60 mph or 0..100 km/h to specify the reference speeds.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bodyType' => 'Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'callSign' => 'A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', + 'cargoVolume' => 'The available volume for cargo or luggage. For automobiles, this is usually the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic foot/feet Note: You can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'dateVehicleFirstRegistered' => 'The date of the first registration of the vehicle with the respective public authorities.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'driveWheelConfiguration' => 'The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle\'s engine via the drivetrain.', + 'emissionsCO2' => 'The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put "g/km" into the unitText property of that value, since there is no UN/CEFACT Common Code for "g/km".', + 'fuelCapacity' => 'The capacity of the fuel tank or in the case of electric cars, the battery. If there are multiple components for storage, this should indicate the total of all storage of the same type. Typical unit code(s): LTR for liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for ampere-hours (for electrical vehicles).', + 'fuelConsumption' => 'The amount of fuel consumed for traveling a particular distance or temporal duration with the given vehicle (e.g. liters per 100 km). * Note 1: There are unfortunately no standard unit codes for liters per 100 km. Use [[unitText]] to indicate the unit of measurement, e.g. L/100 km. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel consumption to another value.', + 'fuelEfficiency' => 'The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers per liter (km/L). * Note 1: There are unfortunately no standard unit codes for miles per gallon or kilometers per liter. Use [[unitText]] to indicate the unit of measurement, e.g. mpg or km/L. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel economy to another value.', + 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'knownVehicleDamages' => 'A textual description of known damages, both repaired and unrepaired.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'meetsEmissionStandard' => 'Indicates that the vehicle meets the respective emission standard.', + 'mileageFromOdometer' => 'The total distance travelled by the particular vehicle since its initial production, as read from its odometer. Typical unit code(s): KMT for kilometers, SMI for statute miles', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'modelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + 'numberOfAirbags' => 'The number or type of airbags in the vehicle.', + 'numberOfAxles' => 'The number of axles. Typical unit code(s): C62', + 'numberOfDoors' => 'The number of doors. Typical unit code(s): C62', + 'numberOfForwardGears' => 'The total number of forward gears available for the transmission system of the vehicle. Typical unit code(s): C62', + 'numberOfPreviousOwners' => 'The number of owners of the vehicle, including the current one. Typical unit code(s): C62', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'payload' => 'The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: Many databases specify the permitted TOTAL weight instead, which is the sum of [[weight]] and [[payload]] * Note 2: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 3: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 4: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seatingCapacity' => 'The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons ', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'speed' => 'The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit of the speed range (indicated by [[maxValue]] should be the maximum speed achievable under regular conditions. Typical unit code(s): KMH for km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use [[minValue]] and [[maxValue]] to indicate the range. Typically, the minimal value is zero. * Note 2: There are many different ways of measuring the speed range. You can link to information about how the given value has been determined using the [[valueReference]] property.', + 'steeringPosition' => 'The position of the steering wheel or similar device (mostly for cars).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'tongueWeight' => 'The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'trailerWeight' => 'The permitted weight of a trailer attached to the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'url' => 'URL of the item.', + 'vehicleConfiguration' => 'A short text indicating the configuration of the vehicle, e.g. \'5dr hatchback ST 2.5 MT 225 hp\' or \'limited edition\'.', + 'vehicleEngine' => 'Information about the engine or engines of the vehicle.', + 'vehicleIdentificationNumber' => 'The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles.', + 'vehicleInteriorColor' => 'The color or color combination of the interior of the vehicle.', + 'vehicleInteriorType' => 'The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.). While most interior types are characterized by the material used, an interior type can also be based on vehicle usage or target audience.', + 'vehicleModelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'vehicleSeatingCapacity' => 'The number of passengers that can be seated in the vehicle, both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons.', + 'vehicleSpecialUsage' => 'Indicates whether the vehicle has been used for special purposes, like commercial rental, driving school, or as a taxi. The legislation in many countries requires this information to be revealed when offering a car for sale.', + 'vehicleTransmission' => 'The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars).', + 'weight' => 'The weight of the product or person.', + 'weightTotal' => 'The permitted total weight of the loaded vehicle, including passengers and cargo and the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'wheelbase' => 'The distance between the centers of the front and rear wheels. Typical unit code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet', + 'width' => 'The width of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The number of passengers that can be seated in the vehicle, both in terms - * of the physical space available, and in terms of limitations set by law. - * Typical unit code(s): C62 for persons. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $vehicleSeatingCapacity; - /** - * Indicates whether the vehicle has been used for special purposes, like - * commercial rental, driving school, or as a taxi. The legislation in many - * countries requires this information to be revealed when offering a car for - * sale. - * - * @var mixed|CarUsageType|string [schema.org types: CarUsageType, Text] - */ - public $vehicleSpecialUsage; - /** - * The type of component used for transmitting the power from a rotating power - * source to the wheels or other relevant component(s) ("gearbox" for cars). - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $vehicleTransmission; - /** - * The permitted total weight of the loaded vehicle, including passengers and - * cargo and the weight of the empty vehicle. Typical unit code(s): KGM for - * kilogram, LBR for pound Note 1: You can indicate additional information in - * the name of the QuantitativeValue node. Note 2: You may also link to a - * QualitativeValue node that provides additional information using - * valueReference. Note 3: Note that you can use minValue and maxValue to - * indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $weightTotal; - /** - * The distance between the centers of the front and rear wheels. Typical unit - * code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for - * foot/feet - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $wheelbase; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accelerationTime', 'bodyType', 'callSign', 'cargoVolume', 'dateVehicleFirstRegistered', 'driveWheelConfiguration', 'emissionsCO2', 'fuelCapacity', 'fuelConsumption', 'fuelEfficiency', 'fuelType', 'knownVehicleDamages', 'meetsEmissionStandard', 'mileageFromOdometer', 'modelDate', 'numberOfAirbags', 'numberOfAxles', 'numberOfDoors', 'numberOfForwardGears', 'numberOfPreviousOwners', 'payload', 'productionDate', 'purchaseDate', 'seatingCapacity', 'speed', 'steeringPosition', 'tongueWeight', 'trailerWeight', 'vehicleConfiguration', 'vehicleEngine', 'vehicleIdentificationNumber', 'vehicleInteriorColor', 'vehicleInteriorType', 'vehicleModelDate', 'vehicleSeatingCapacity', 'vehicleSpecialUsage', 'vehicleTransmission', 'weightTotal', 'wheelbase'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MotorcycleDealer.php b/src/models/jsonld/MotorcycleDealer.php index 5d38dc13e..f54c69f3b 100644 --- a/src/models/jsonld/MotorcycleDealer.php +++ b/src/models/jsonld/MotorcycleDealer.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MotorcycleDealerInterface.php b/src/models/jsonld/MotorcycleDealerInterface.php new file mode 100644 index 000000000..91340a0ef --- /dev/null +++ b/src/models/jsonld/MotorcycleDealerInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MotorcycleRepairInterface.php b/src/models/jsonld/MotorcycleRepairInterface.php new file mode 100644 index 000000000..7272f27b2 --- /dev/null +++ b/src/models/jsonld/MotorcycleRepairInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accelerationTime' => ['QuantitativeValue'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bodyType' => ['QualitativeValue', 'Text', 'URL'], + 'brand' => ['Organization', 'Brand'], + 'callSign' => ['Text'], + 'cargoVolume' => ['QuantitativeValue'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'dateVehicleFirstRegistered' => ['Date'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'driveWheelConfiguration' => ['Text', 'DriveWheelConfigurationValue'], + 'emissionsCO2' => ['Number'], + 'fuelCapacity' => ['QuantitativeValue'], + 'fuelConsumption' => ['QuantitativeValue'], + 'fuelEfficiency' => ['QuantitativeValue'], + 'fuelType' => ['Text', 'URL', 'QualitativeValue'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knownVehicleDamages' => ['Text'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'meetsEmissionStandard' => ['Text', 'URL', 'QualitativeValue'], + 'mileageFromOdometer' => ['QuantitativeValue'], + 'model' => ['ProductModel', 'Text'], + 'modelDate' => ['Date'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'numberOfAirbags' => ['Text', 'Number'], + 'numberOfAxles' => ['Number', 'QuantitativeValue'], + 'numberOfDoors' => ['QuantitativeValue', 'Number'], + 'numberOfForwardGears' => ['QuantitativeValue', 'Number'], + 'numberOfPreviousOwners' => ['Number', 'QuantitativeValue'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'payload' => ['QuantitativeValue'], + 'potentialAction' => ['Action'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seatingCapacity' => ['QuantitativeValue', 'Number'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'speed' => ['QuantitativeValue'], + 'steeringPosition' => ['SteeringPositionValue'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'tongueWeight' => ['QuantitativeValue'], + 'trailerWeight' => ['QuantitativeValue'], + 'url' => ['URL'], + 'vehicleConfiguration' => ['Text'], + 'vehicleEngine' => ['EngineSpecification'], + 'vehicleIdentificationNumber' => ['Text'], + 'vehicleInteriorColor' => ['Text'], + 'vehicleInteriorType' => ['Text'], + 'vehicleModelDate' => ['Date'], + 'vehicleSeatingCapacity' => ['QuantitativeValue', 'Number'], + 'vehicleSpecialUsage' => ['CarUsageType', 'Text'], + 'vehicleTransmission' => ['Text', 'QualitativeValue', 'URL'], + 'weight' => ['QuantitativeValue'], + 'weightTotal' => ['QuantitativeValue'], + 'wheelbase' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accelerationTime', - 'bodyType', - 'callSign', - 'cargoVolume', - 'dateVehicleFirstRegistered', - 'driveWheelConfiguration', - 'emissionsCO2', - 'fuelCapacity', - 'fuelConsumption', - 'fuelEfficiency', - 'fuelType', - 'knownVehicleDamages', - 'meetsEmissionStandard', - 'mileageFromOdometer', - 'modelDate', - 'numberOfAirbags', - 'numberOfAxles', - 'numberOfDoors', - 'numberOfForwardGears', - 'numberOfPreviousOwners', - 'payload', - 'productionDate', - 'purchaseDate', - 'seatingCapacity', - 'speed', - 'steeringPosition', - 'tongueWeight', - 'trailerWeight', - 'vehicleConfiguration', - 'vehicleEngine', - 'vehicleIdentificationNumber', - 'vehicleInteriorColor', - 'vehicleInteriorType', - 'vehicleModelDate', - 'vehicleSeatingCapacity', - 'vehicleSpecialUsage', - 'vehicleTransmission', - 'weightTotal', - 'wheelbase' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accelerationTime' => ['QuantitativeValue'], - 'bodyType' => ['QualitativeValue', 'Text', 'URL'], - 'callSign' => ['Text'], - 'cargoVolume' => ['QuantitativeValue'], - 'dateVehicleFirstRegistered' => ['Date'], - 'driveWheelConfiguration' => ['DriveWheelConfigurationValue', 'Text'], - 'emissionsCO2' => ['Number'], - 'fuelCapacity' => ['QuantitativeValue'], - 'fuelConsumption' => ['QuantitativeValue'], - 'fuelEfficiency' => ['QuantitativeValue'], - 'fuelType' => ['QualitativeValue', 'Text', 'URL'], - 'knownVehicleDamages' => ['Text'], - 'meetsEmissionStandard' => ['QualitativeValue', 'Text', 'URL'], - 'mileageFromOdometer' => ['QuantitativeValue'], - 'modelDate' => ['Date'], - 'numberOfAirbags' => ['Number', 'Text'], - 'numberOfAxles' => ['Number', 'QuantitativeValue'], - 'numberOfDoors' => ['Number', 'QuantitativeValue'], - 'numberOfForwardGears' => ['Number', 'QuantitativeValue'], - 'numberOfPreviousOwners' => ['Number', 'QuantitativeValue'], - 'payload' => ['QuantitativeValue'], - 'productionDate' => ['Date'], - 'purchaseDate' => ['Date'], - 'seatingCapacity' => ['Number', 'QuantitativeValue'], - 'speed' => ['QuantitativeValue'], - 'steeringPosition' => ['SteeringPositionValue'], - 'tongueWeight' => ['QuantitativeValue'], - 'trailerWeight' => ['QuantitativeValue'], - 'vehicleConfiguration' => ['Text'], - 'vehicleEngine' => ['EngineSpecification'], - 'vehicleIdentificationNumber' => ['Text'], - 'vehicleInteriorColor' => ['Text'], - 'vehicleInteriorType' => ['Text'], - 'vehicleModelDate' => ['Date'], - 'vehicleSeatingCapacity' => ['Number', 'QuantitativeValue'], - 'vehicleSpecialUsage' => ['CarUsageType', 'Text'], - 'vehicleTransmission' => ['QualitativeValue', 'Text', 'URL'], - 'weightTotal' => ['QuantitativeValue'], - 'wheelbase' => ['QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accelerationTime' => 'The time needed to accelerate the vehicle from a given start velocity to a given target velocity. Typical unit code(s): SEC for seconds Note: There are unfortunately no standard unit codes for seconds/0..100 km/h or seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities in the name of the QuantitativeValue, or use valueReference with a QuantitativeValue of 0..60 mph or 0..100 km/h to specify the reference speeds.', - 'bodyType' => 'Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).', - 'callSign' => 'A callsign, as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', - 'cargoVolume' => 'The available volume for cargo or luggage. For automobiles, this is usually the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic foot/feet Note: You can use minValue and maxValue to indicate ranges.', - 'dateVehicleFirstRegistered' => 'The date of the first registration of the vehicle with the respective public authorities.', - 'driveWheelConfiguration' => 'The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle\'s engine via the drivetrain.', - 'emissionsCO2' => 'The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put "g/km" into the unitText property of that value, since there is no UN/CEFACT Common Code for "g/km".', - 'fuelCapacity' => 'The capacity of the fuel tank or in the case of electric cars, the battery. If there are multiple components for storage, this should indicate the total of all storage of the same type. Typical unit code(s): LTR for liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for ampere-hours (for electrical vehicles).', - 'fuelConsumption' => 'The amount of fuel consumed for traveling a particular distance or temporal duration with the given vehicle (e.g. liters per 100 km). Note 1: There are unfortunately no standard unit codes for liters per 100 km. Use unitText to indicate the unit of measurement, e.g. L/100 km. Note 2: There are two ways of indicating the fuel consumption, fuelConsumption (e.g. 8 liters per 100 km) and fuelEfficiency (e.g. 30 miles per gallon). They are reciprocal. Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use valueReference to link the value for the fuel consumption to another value.', - 'fuelEfficiency' => 'The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers per liter (km/L). Note 1: There are unfortunately no standard unit codes for miles per gallon or kilometers per liter. Use unitText to indicate the unit of measurement, e.g. mpg or km/L. Note 2: There are two ways of indicating the fuel consumption, fuelConsumption (e.g. 8 liters per 100 km) and fuelEfficiency (e.g. 30 miles per gallon). They are reciprocal. Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use valueReference to link the value for the fuel economy to another value.', - 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', - 'knownVehicleDamages' => 'A textual description of known damages, both repaired and unrepaired.', - 'meetsEmissionStandard' => 'Indicates that the vehicle meets the respective emission standard.', - 'mileageFromOdometer' => 'The total distance travelled by the particular vehicle since its initial production, as read from its odometer. Typical unit code(s): KMT for kilometers, SMI for statute miles', - 'modelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', - 'numberOfAirbags' => 'The number or type of airbags in the vehicle.', - 'numberOfAxles' => 'The number of axles. Typical unit code(s): C62', - 'numberOfDoors' => 'The number of doors. Typical unit code(s): C62', - 'numberOfForwardGears' => 'The total number of forward gears available for the transmission system of the vehicle. Typical unit code(s): C62', - 'numberOfPreviousOwners' => 'The number of owners of the vehicle, including the current one. Typical unit code(s): C62', - 'payload' => 'The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note 1: Many databases specify the permitted TOTAL weight instead, which is the sum of weight and payload Note 2: You can indicate additional information in the name of the QuantitativeValue node. Note 3: You may also link to a QualitativeValue node that provides additional information using valueReference. Note 4: Note that you can use minValue and maxValue to indicate ranges.', - 'productionDate' => 'The date of production of the item, e.g. vehicle.', - 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', - 'seatingCapacity' => 'The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons', - 'speed' => 'The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit of the speed range (indicated by maxValue should be the maximum speed achievable under regular conditions. Typical unit code(s): KMH for km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use minValue and maxValue to indicate the range. Typically, the minimal value is zero. * Note 2: There are many different ways of measuring the speed range. You can link to information about how the given value has been determined using the valueReference property.', - 'steeringPosition' => 'The position of the steering wheel or similar device (mostly for cars).', - 'tongueWeight' => 'The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can indicate additional information in the name of the QuantitativeValue node. Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference. Note 3: Note that you can use minValue and maxValue to indicate ranges.', - 'trailerWeight' => 'The permitted weight of a trailer attached to the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the name of the QuantitativeValue node. * Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference. * Note 3: Note that you can use minValue and maxValue to indicate ranges.', - 'vehicleConfiguration' => 'A short text indicating the configuration of the vehicle, e.g. \'5dr hatchback ST 2.5 MT 225 hp\' or \'limited edition\'.', - 'vehicleEngine' => 'Information about the engine or engines of the vehicle.', - 'vehicleIdentificationNumber' => 'The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles.', - 'vehicleInteriorColor' => 'The color or color combination of the interior of the vehicle.', - 'vehicleInteriorType' => 'The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.). While most interior types are characterized by the material used, an interior type can also be based on vehicle usage or target audience.', - 'vehicleModelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', - 'vehicleSeatingCapacity' => 'The number of passengers that can be seated in the vehicle, both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons.', - 'vehicleSpecialUsage' => 'Indicates whether the vehicle has been used for special purposes, like commercial rental, driving school, or as a taxi. The legislation in many countries requires this information to be revealed when offering a car for sale.', - 'vehicleTransmission' => 'The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars).', - 'weightTotal' => 'The permitted total weight of the loaded vehicle, including passengers and cargo and the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can indicate additional information in the name of the QuantitativeValue node. Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference. Note 3: Note that you can use minValue and maxValue to indicate ranges.', - 'wheelbase' => 'The distance between the centers of the front and rear wheels. Typical unit code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The time needed to accelerate the vehicle from a given start velocity to a - * given target velocity. Typical unit code(s): SEC for seconds Note: There - * are unfortunately no standard unit codes for seconds/0..100 km/h or - * seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities - * in the name of the QuantitativeValue, or use valueReference with a - * QuantitativeValue of 0..60 mph or 0..100 km/h to specify the reference - * speeds. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $accelerationTime; /** - * Indicates the design and body style of the vehicle (e.g. station wagon, - * hatchback, etc.). - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $bodyType; - /** - * A callsign, as used in broadcasting and radio communications to identify - * people, radio and TV stations, or vehicles. - * - * @var string [schema.org types: Text] - */ - public $callSign; - /** - * The available volume for cargo or luggage. For automobiles, this is usually - * the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic - * foot/feet Note: You can use minValue and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $cargoVolume; - /** - * The date of the first registration of the vehicle with the respective - * public authorities. - * - * @var Date [schema.org types: Date] - */ - public $dateVehicleFirstRegistered; - /** - * The drive wheel configuration, i.e. which roadwheels will receive torque - * from the vehicle's engine via the drivetrain. - * - * @var mixed|DriveWheelConfigurationValue|string [schema.org types: DriveWheelConfigurationValue, Text] - */ - public $driveWheelConfiguration; - /** - * The CO2 emissions in g/km. When used in combination with a - * QuantitativeValue, put "g/km" into the unitText property of that value, - * since there is no UN/CEFACT Common Code for "g/km". - * - * @var float [schema.org types: Number] - */ - public $emissionsCO2; - /** - * The capacity of the fuel tank or in the case of electric cars, the battery. - * If there are multiple components for storage, this should indicate the - * total of all storage of the same type. Typical unit code(s): LTR for - * liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for - * ampere-hours (for electrical vehicles). - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $fuelCapacity; - /** - * The amount of fuel consumed for traveling a particular distance or temporal - * duration with the given vehicle (e.g. liters per 100 km). Note 1: There are - * unfortunately no standard unit codes for liters per 100 km. Use unitText to - * indicate the unit of measurement, e.g. L/100 km. Note 2: There are two ways - * of indicating the fuel consumption, fuelConsumption (e.g. 8 liters per 100 - * km) and fuelEfficiency (e.g. 30 miles per gallon). They are reciprocal. - * Note 3: Often, the absolute value is useful only when related to driving - * speed ("at 80 km/h") or usage pattern ("city traffic"). You can use - * valueReference to link the value for the fuel consumption to another value. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $fuelConsumption; - /** - * The distance traveled per unit of fuel used; most commonly miles per gallon - * (mpg) or kilometers per liter (km/L). Note 1: There are unfortunately no - * standard unit codes for miles per gallon or kilometers per liter. Use - * unitText to indicate the unit of measurement, e.g. mpg or km/L. Note 2: - * There are two ways of indicating the fuel consumption, fuelConsumption - * (e.g. 8 liters per 100 km) and fuelEfficiency (e.g. 30 miles per gallon). - * They are reciprocal. Note 3: Often, the absolute value is useful only when - * related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). - * You can use valueReference to link the value for the fuel economy to - * another value. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $fuelEfficiency; - /** - * The type of fuel suitable for the engine or engines of the vehicle. If the - * vehicle has only one engine, this property can be attached directly to the - * vehicle. - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $fuelType; - /** - * A textual description of known damages, both repaired and unrepaired. - * - * @var string [schema.org types: Text] - */ - public $knownVehicleDamages; - /** - * Indicates that the vehicle meets the respective emission standard. - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $meetsEmissionStandard; - /** - * The total distance travelled by the particular vehicle since its initial - * production, as read from its odometer. Typical unit code(s): KMT for - * kilometers, SMI for statute miles - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $mileageFromOdometer; - /** - * The release date of a vehicle model (often used to differentiate versions - * of the same make and model). - * - * @var Date [schema.org types: Date] - */ - public $modelDate; - /** - * The number or type of airbags in the vehicle. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $numberOfAirbags; - /** - * The number of axles. Typical unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfAxles; - /** - * The number of doors. Typical unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfDoors; - /** - * The total number of forward gears available for the transmission system of - * the vehicle. Typical unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfForwardGears; - /** - * The number of owners of the vehicle, including the current one. Typical - * unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfPreviousOwners; - /** - * The permitted weight of passengers and cargo, EXCLUDING the weight of the - * empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note - * 1: Many databases specify the permitted TOTAL weight instead, which is the - * sum of weight and payload Note 2: You can indicate additional information - * in the name of the QuantitativeValue node. Note 3: You may also link to a - * QualitativeValue node that provides additional information using - * valueReference. Note 4: Note that you can use minValue and maxValue to - * indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $payload; - /** - * The date of production of the item, e.g. vehicle. - * - * @var Date [schema.org types: Date] - */ - public $productionDate; - /** - * The date the item e.g. vehicle was purchased by the current owner. - * - * @var Date [schema.org types: Date] - */ - public $purchaseDate; - /** - * The number of persons that can be seated (e.g. in a vehicle), both in terms - * of the physical space available, and in terms of limitations set by law. - * Typical unit code(s): C62 for persons - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $seatingCapacity; - /** - * The speed range of the vehicle. If the vehicle is powered by an engine, the - * upper limit of the speed range (indicated by maxValue should be the maximum - * speed achievable under regular conditions. Typical unit code(s): KMH for - * km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use - * minValue and maxValue to indicate the range. Typically, the minimal value - * is zero. * Note 2: There are many different ways of measuring the speed - * range. You can link to information about how the given value has been - * determined using the valueReference property. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $speed; - /** - * The position of the steering wheel or similar device (mostly for cars). - * - * @var SteeringPositionValue [schema.org types: SteeringPositionValue] - */ - public $steeringPosition; - /** - * The permitted vertical load (TWR) of a trailer attached to the vehicle. - * Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) - * Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can - * indicate additional information in the name of the QuantitativeValue node. - * Note 2: You may also link to a QualitativeValue node that provides - * additional information using valueReference. Note 3: Note that you can use - * minValue and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $tongueWeight; - /** - * The permitted weight of a trailer attached to the vehicle. Typical unit - * code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate - * additional information in the name of the QuantitativeValue node. * Note 2: - * You may also link to a QualitativeValue node that provides additional - * information using valueReference. * Note 3: Note that you can use minValue - * and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $trailerWeight; - /** - * A short text indicating the configuration of the vehicle, e.g. '5dr - * hatchback ST 2.5 MT 225 hp' or 'limited edition'. - * - * @var string [schema.org types: Text] - */ - public $vehicleConfiguration; - /** - * Information about the engine or engines of the vehicle. - * - * @var EngineSpecification [schema.org types: EngineSpecification] - */ - public $vehicleEngine; - /** - * The Vehicle Identification Number (VIN) is a unique serial number used by - * the automotive industry to identify individual motor vehicles. - * - * @var string [schema.org types: Text] - */ - public $vehicleIdentificationNumber; - /** - * The color or color combination of the interior of the vehicle. - * - * @var string [schema.org types: Text] - */ - public $vehicleInteriorColor; - /** - * The type or material of the interior of the vehicle (e.g. synthetic fabric, - * leather, wood, etc.). While most interior types are characterized by the - * material used, an interior type can also be based on vehicle usage or - * target audience. - * - * @var string [schema.org types: Text] - */ - public $vehicleInteriorType; - /** - * The release date of a vehicle model (often used to differentiate versions - * of the same make and model). - * - * @var Date [schema.org types: Date] + * @inheritdoc */ - public $vehicleModelDate; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accelerationTime' => 'The time needed to accelerate the vehicle from a given start velocity to a given target velocity. Typical unit code(s): SEC for seconds * Note: There are unfortunately no standard unit codes for seconds/0..100 km/h or seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities in the [[name]] of the [[QuantitativeValue]], or use [[valueReference]] with a [[QuantitativeValue]] of 0..60 mph or 0..100 km/h to specify the reference speeds.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bodyType' => 'Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'callSign' => 'A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', + 'cargoVolume' => 'The available volume for cargo or luggage. For automobiles, this is usually the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic foot/feet Note: You can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'dateVehicleFirstRegistered' => 'The date of the first registration of the vehicle with the respective public authorities.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'driveWheelConfiguration' => 'The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle\'s engine via the drivetrain.', + 'emissionsCO2' => 'The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put "g/km" into the unitText property of that value, since there is no UN/CEFACT Common Code for "g/km".', + 'fuelCapacity' => 'The capacity of the fuel tank or in the case of electric cars, the battery. If there are multiple components for storage, this should indicate the total of all storage of the same type. Typical unit code(s): LTR for liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for ampere-hours (for electrical vehicles).', + 'fuelConsumption' => 'The amount of fuel consumed for traveling a particular distance or temporal duration with the given vehicle (e.g. liters per 100 km). * Note 1: There are unfortunately no standard unit codes for liters per 100 km. Use [[unitText]] to indicate the unit of measurement, e.g. L/100 km. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel consumption to another value.', + 'fuelEfficiency' => 'The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers per liter (km/L). * Note 1: There are unfortunately no standard unit codes for miles per gallon or kilometers per liter. Use [[unitText]] to indicate the unit of measurement, e.g. mpg or km/L. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel economy to another value.', + 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'knownVehicleDamages' => 'A textual description of known damages, both repaired and unrepaired.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'meetsEmissionStandard' => 'Indicates that the vehicle meets the respective emission standard.', + 'mileageFromOdometer' => 'The total distance travelled by the particular vehicle since its initial production, as read from its odometer. Typical unit code(s): KMT for kilometers, SMI for statute miles', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'modelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + 'numberOfAirbags' => 'The number or type of airbags in the vehicle.', + 'numberOfAxles' => 'The number of axles. Typical unit code(s): C62', + 'numberOfDoors' => 'The number of doors. Typical unit code(s): C62', + 'numberOfForwardGears' => 'The total number of forward gears available for the transmission system of the vehicle. Typical unit code(s): C62', + 'numberOfPreviousOwners' => 'The number of owners of the vehicle, including the current one. Typical unit code(s): C62', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'payload' => 'The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: Many databases specify the permitted TOTAL weight instead, which is the sum of [[weight]] and [[payload]] * Note 2: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 3: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 4: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seatingCapacity' => 'The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons ', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'speed' => 'The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit of the speed range (indicated by [[maxValue]] should be the maximum speed achievable under regular conditions. Typical unit code(s): KMH for km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use [[minValue]] and [[maxValue]] to indicate the range. Typically, the minimal value is zero. * Note 2: There are many different ways of measuring the speed range. You can link to information about how the given value has been determined using the [[valueReference]] property.', + 'steeringPosition' => 'The position of the steering wheel or similar device (mostly for cars).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'tongueWeight' => 'The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'trailerWeight' => 'The permitted weight of a trailer attached to the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'url' => 'URL of the item.', + 'vehicleConfiguration' => 'A short text indicating the configuration of the vehicle, e.g. \'5dr hatchback ST 2.5 MT 225 hp\' or \'limited edition\'.', + 'vehicleEngine' => 'Information about the engine or engines of the vehicle.', + 'vehicleIdentificationNumber' => 'The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles.', + 'vehicleInteriorColor' => 'The color or color combination of the interior of the vehicle.', + 'vehicleInteriorType' => 'The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.). While most interior types are characterized by the material used, an interior type can also be based on vehicle usage or target audience.', + 'vehicleModelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'vehicleSeatingCapacity' => 'The number of passengers that can be seated in the vehicle, both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons.', + 'vehicleSpecialUsage' => 'Indicates whether the vehicle has been used for special purposes, like commercial rental, driving school, or as a taxi. The legislation in many countries requires this information to be revealed when offering a car for sale.', + 'vehicleTransmission' => 'The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars).', + 'weight' => 'The weight of the product or person.', + 'weightTotal' => 'The permitted total weight of the loaded vehicle, including passengers and cargo and the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'wheelbase' => 'The distance between the centers of the front and rear wheels. Typical unit code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet', + 'width' => 'The width of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The number of passengers that can be seated in the vehicle, both in terms - * of the physical space available, and in terms of limitations set by law. - * Typical unit code(s): C62 for persons. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $vehicleSeatingCapacity; - /** - * Indicates whether the vehicle has been used for special purposes, like - * commercial rental, driving school, or as a taxi. The legislation in many - * countries requires this information to be revealed when offering a car for - * sale. - * - * @var mixed|CarUsageType|string [schema.org types: CarUsageType, Text] - */ - public $vehicleSpecialUsage; - /** - * The type of component used for transmitting the power from a rotating power - * source to the wheels or other relevant component(s) ("gearbox" for cars). - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $vehicleTransmission; - /** - * The permitted total weight of the loaded vehicle, including passengers and - * cargo and the weight of the empty vehicle. Typical unit code(s): KGM for - * kilogram, LBR for pound Note 1: You can indicate additional information in - * the name of the QuantitativeValue node. Note 2: You may also link to a - * QualitativeValue node that provides additional information using - * valueReference. Note 3: Note that you can use minValue and maxValue to - * indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $weightTotal; - /** - * The distance between the centers of the front and rear wheels. Typical unit - * code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for - * foot/feet - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $wheelbase; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accelerationTime', 'bodyType', 'callSign', 'cargoVolume', 'dateVehicleFirstRegistered', 'driveWheelConfiguration', 'emissionsCO2', 'fuelCapacity', 'fuelConsumption', 'fuelEfficiency', 'fuelType', 'knownVehicleDamages', 'meetsEmissionStandard', 'mileageFromOdometer', 'modelDate', 'numberOfAirbags', 'numberOfAxles', 'numberOfDoors', 'numberOfForwardGears', 'numberOfPreviousOwners', 'payload', 'productionDate', 'purchaseDate', 'seatingCapacity', 'speed', 'steeringPosition', 'tongueWeight', 'trailerWeight', 'vehicleConfiguration', 'vehicleEngine', 'vehicleIdentificationNumber', 'vehicleInteriorColor', 'vehicleInteriorType', 'vehicleModelDate', 'vehicleSeatingCapacity', 'vehicleSpecialUsage', 'vehicleTransmission', 'weightTotal', 'wheelbase'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MotorizedBicycleInterface.php b/src/models/jsonld/MotorizedBicycleInterface.php new file mode 100644 index 000000000..921664f51 --- /dev/null +++ b/src/models/jsonld/MotorizedBicycleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MountainInterface.php b/src/models/jsonld/MountainInterface.php new file mode 100644 index 000000000..40aa1bbb6 --- /dev/null +++ b/src/models/jsonld/MountainInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'fromLocation', - 'toLocation' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'fromLocation' => ['Place'], - 'toLocation' => ['Place'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The original location of the object or the - * agent before the action. - * - * @var Place [schema.org types: Place] - */ - public $fromLocation; - /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['fromLocation', 'toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MoveActionInterface.php b/src/models/jsonld/MoveActionInterface.php new file mode 100644 index 000000000..90325127a --- /dev/null +++ b/src/models/jsonld/MoveActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'subtitleLanguage' => ['Language', 'Text'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'titleEIDR' => ['URL', 'Text'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'countryOfOrigin', - 'director', - 'duration', - 'musicBy', - 'productionCompany', - 'subtitleLanguage', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'countryOfOrigin' => ['Country'], - 'director' => ['Person'], - 'duration' => ['Duration'], - 'musicBy' => ['MusicGroup', 'Person'], - 'productionCompany' => ['Organization'], - 'subtitleLanguage' => ['Language', 'Text'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'countryOfOrigin' => 'The country of the principal offices of the production company or individual responsible for the movie or program.', - '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. Supersedes directors.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'musicBy' => 'The composer of the soundtrack.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'subtitleLanguage' => 'Languages in which subtitles/captions are available, in IETF BCP 47 standard format.', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The country of the principal offices of the production company or - * individual responsible for the movie or program. - * - * @var Country [schema.org types: Country] - */ - public $countryOfOrigin; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $director; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'subtitleLanguage' => 'Languages in which subtitles/captions are available, in [IETF BCP 47 standard format](http://tools.ietf.org/html/bcp47).', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'titleEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing at the most general/abstract level, a work of film or television. For example, the motion picture known as "Ghostbusters" has a titleEIDR of "10.5240/7EC7-228A-510A-053E-CBB8-J". This title (or work) may have several variants, which EIDR calls "edits". See [[editEIDR]]. Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; /** - * Languages in which subtitles/captions are available, in IETF BCP 47 - * standard format. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $subtitleLanguage; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'countryOfOrigin', 'director', 'duration', 'musicBy', 'productionCompany', 'subtitleLanguage', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MovieClip.php b/src/models/jsonld/MovieClip.php index 0426eb30e..e58f59f75 100644 --- a/src/models/jsonld/MovieClip.php +++ b/src/models/jsonld/MovieClip.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'clipNumber' => ['Text', 'Integer'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endOffset' => ['Number', 'HyperTocEntry'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfEpisode' => ['Episode'], + 'partOfSeason' => ['CreativeWorkSeason'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startOffset' => ['Number', 'HyperTocEntry'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'clipNumber', - 'director', - 'endOffset', - 'musicBy', - 'partOfEpisode', - 'partOfSeason', - 'partOfSeries', - 'startOffset' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'clipNumber' => ['Integer', 'Text'], - 'director' => ['Person'], - 'endOffset' => ['Number'], - 'musicBy' => ['MusicGroup', 'Person'], - 'partOfEpisode' => ['Episode'], - 'partOfSeason' => ['CreativeWorkSeason'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'startOffset' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'clipNumber' => 'Position of the clip within an ordered group of clips.', - '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. Supersedes directors.', - 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', - 'musicBy' => 'The composer of the soundtrack.', - 'partOfEpisode' => 'The episode to which this clip belongs.', - 'partOfSeason' => 'The season to which this episode belongs.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * Position of the clip within an ordered group of clips. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $clipNumber; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The end time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $endOffset; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'clipNumber' => 'Position of the clip within an ordered group of clips.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'partOfEpisode' => 'The episode to which this clip belongs.', + 'partOfSeason' => 'The season to which this episode belongs.', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The episode to which this clip belongs. - * - * @var Episode [schema.org types: Episode] - */ - public $partOfEpisode; - /** - * The season to which this episode belongs. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $partOfSeason; - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; - /** - * The start time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $startOffset; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'clipNumber', 'director', 'endOffset', 'musicBy', 'partOfEpisode', 'partOfSeason', 'partOfSeries', 'startOffset'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MovieClipInterface.php b/src/models/jsonld/MovieClipInterface.php new file mode 100644 index 000000000..839c6c819 --- /dev/null +++ b/src/models/jsonld/MovieClipInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MovieRentalStoreInterface.php b/src/models/jsonld/MovieRentalStoreInterface.php new file mode 100644 index 000000000..0a524431f --- /dev/null +++ b/src/models/jsonld/MovieRentalStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'director', - 'musicBy', - 'productionCompany', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'director' => ['Person'], - 'musicBy' => ['MusicGroup', 'Person'], - 'productionCompany' => ['Organization'], - 'trailer' => ['VideoObject'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - '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. Supersedes directors.', - 'musicBy' => 'The composer of the soundtrack.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'director', 'musicBy', 'productionCompany', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MovieSeriesInterface.php b/src/models/jsonld/MovieSeriesInterface.php new file mode 100644 index 000000000..9a008c02e --- /dev/null +++ b/src/models/jsonld/MovieSeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'screenCount' => ['Number'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'screenCount' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'screenCount' => 'The number of screens in the movie theater.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'screenCount' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'screenCount' => 'The number of screens in the movie theater.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of screens in the movie theater. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $screenCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['screenCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MovieTheaterInterface.php b/src/models/jsonld/MovieTheaterInterface.php new file mode 100644 index 000000000..886592e26 --- /dev/null +++ b/src/models/jsonld/MovieTheaterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MovingCompanyInterface.php b/src/models/jsonld/MovingCompanyInterface.php new file mode 100644 index 000000000..82b0969a6 --- /dev/null +++ b/src/models/jsonld/MovingCompanyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MultiCenterTrialInterface.php b/src/models/jsonld/MultiCenterTrialInterface.php new file mode 100644 index 000000000..4ae1c83b3 --- /dev/null +++ b/src/models/jsonld/MultiCenterTrialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MultiPlayerInterface.php b/src/models/jsonld/MultiPlayerInterface.php new file mode 100644 index 000000000..d777703dd --- /dev/null +++ b/src/models/jsonld/MultiPlayerInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MulticellularParasiteInterface.php b/src/models/jsonld/MulticellularParasiteInterface.php new file mode 100644 index 000000000..4bd251919 --- /dev/null +++ b/src/models/jsonld/MulticellularParasiteInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'antagonist' => ['Muscle'], + 'associatedPathophysiology' => ['Text'], + 'bloodSupply' => ['Vessel'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'insertion' => ['AnatomicalStructure'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'muscleAction' => ['Text'], + 'name' => ['Text'], + 'nerve' => ['Nerve'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'antagonist', - 'bloodSupply', - 'insertion', - 'muscleAction', - 'nerve' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'antagonist' => ['Muscle'], - 'bloodSupply' => ['Vessel'], - 'insertion' => ['AnatomicalStructure'], - 'muscleAction' => ['Text'], - 'nerve' => ['Nerve'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'antagonist' => 'The muscle whose action counteracts the specified muscle.', - 'bloodSupply' => 'The blood vessel that carries blood from the heart to the muscle.', - 'insertion' => 'The place of attachment of a muscle, or what the muscle moves.', - 'muscleAction' => 'The movement the muscle generates.', - 'nerve' => 'The underlying innervation associated with the muscle.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'antagonist' => 'The muscle whose action counteracts the specified muscle.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bloodSupply' => 'The blood vessel that carries blood from the heart to the muscle.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'insertion' => 'The place of attachment of a muscle, or what the muscle moves.', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'muscleAction' => 'The movement the muscle generates.', + 'name' => 'The name of the item.', + 'nerve' => 'The underlying innervation associated with the muscle.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The muscle whose action counteracts the specified muscle. - * - * @var Muscle [schema.org types: Muscle] - */ - public $antagonist; - /** - * The blood vessel that carries blood from the heart to the muscle. - * - * @var Vessel [schema.org types: Vessel] - */ - public $bloodSupply; - /** - * The place of attachment of a muscle, or what the muscle moves. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] - */ - public $insertion; - /** - * The movement the muscle generates. - * - * @var string [schema.org types: Text] - */ - public $muscleAction; - /** - * The underlying innervation associated with the muscle. - * - * @var Nerve [schema.org types: Nerve] + * @inheritdoc */ - public $nerve; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['antagonist', 'bloodSupply', 'insertion', 'muscleAction', 'nerve'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MuscleInterface.php b/src/models/jsonld/MuscleInterface.php new file mode 100644 index 000000000..a34773d1d --- /dev/null +++ b/src/models/jsonld/MuscleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusculoskeletalExam.php b/src/models/jsonld/MusculoskeletalExam.php index a6c112341..c132c996c 100644 --- a/src/models/jsonld/MusculoskeletalExam.php +++ b/src/models/jsonld/MusculoskeletalExam.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusculoskeletalExamInterface.php b/src/models/jsonld/MusculoskeletalExamInterface.php new file mode 100644 index 000000000..5d344f8c1 --- /dev/null +++ b/src/models/jsonld/MusculoskeletalExamInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MuseumInterface.php b/src/models/jsonld/MuseumInterface.php new file mode 100644 index 000000000..41b5974aa --- /dev/null +++ b/src/models/jsonld/MuseumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'albumProductionType' => ['MusicAlbumProductionType'], + 'albumRelease' => ['MusicRelease'], + 'albumReleaseType' => ['MusicAlbumReleaseType'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'byArtist' => ['Person', 'MusicGroup'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numTracks' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'track' => ['ItemList', 'MusicRecording'], + 'tracks' => ['MusicRecording'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'albumProductionType', - 'albumRelease', - 'albumReleaseType', - 'byArtist' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'albumProductionType' => ['MusicAlbumProductionType'], - 'albumRelease' => ['MusicRelease'], - 'albumReleaseType' => ['MusicAlbumReleaseType'], - 'byArtist' => ['MusicGroup', 'Person'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'albumProductionType' => 'Classification of the album by it\'s type of content: soundtrack, live album, studio album, etc.', - 'albumRelease' => 'A release of this album. Inverse property: releaseOf.', - 'albumReleaseType' => 'The kind of release which this album is: single, EP or album.', - 'byArtist' => 'The artist that performed this album or recording.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'albumProductionType' => 'Classification of the album by it\'s type of content: soundtrack, live album, studio album, etc.', + 'albumRelease' => 'A release of this album.', + 'albumReleaseType' => 'The kind of release which this album is: single, EP or album.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'byArtist' => 'The artist that performed this album or recording.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numTracks' => 'The number of tracks in this album or playlist.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'track' => 'A music recording (track)—usually a single song. If an ItemList is given, the list should contain items of type MusicRecording.', + 'tracks' => 'A music recording (track)—usually a single song.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Classification of the album by it's type of content: soundtrack, live - * album, studio album, etc. - * - * @var MusicAlbumProductionType [schema.org types: MusicAlbumProductionType] - */ - public $albumProductionType; - /** - * A release of this album. Inverse property: releaseOf. - * - * @var MusicRelease [schema.org types: MusicRelease] - */ - public $albumRelease; - /** - * The kind of release which this album is: single, EP or album. - * - * @var MusicAlbumReleaseType [schema.org types: MusicAlbumReleaseType] - */ - public $albumReleaseType; /** - * The artist that performed this album or recording. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] + * @inheritdoc */ - public $byArtist; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['albumProductionType', 'albumRelease', 'albumReleaseType', 'byArtist'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicAlbumInterface.php b/src/models/jsonld/MusicAlbumInterface.php new file mode 100644 index 000000000..aec2bfc69 --- /dev/null +++ b/src/models/jsonld/MusicAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicAlbumProductionTypeInterface.php b/src/models/jsonld/MusicAlbumProductionTypeInterface.php new file mode 100644 index 000000000..4733f6ccf --- /dev/null +++ b/src/models/jsonld/MusicAlbumProductionTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicAlbumReleaseTypeInterface.php b/src/models/jsonld/MusicAlbumReleaseTypeInterface.php new file mode 100644 index 000000000..183fb30b8 --- /dev/null +++ b/src/models/jsonld/MusicAlbumReleaseTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'composer' => ['Organization', 'Person'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'firstPerformance' => ['Event'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'includedComposition' => ['MusicComposition'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'iswcCode' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'lyricist' => ['Person'], + 'lyrics' => ['CreativeWork'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicArrangement' => ['MusicComposition'], + 'musicCompositionForm' => ['Text'], + 'musicalKey' => ['Text'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAs' => ['MusicRecording'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'composer', - 'firstPerformance', - 'includedComposition', - 'iswcCode', - 'lyricist', - 'lyrics', - 'musicArrangement', - 'musicCompositionForm', - 'musicalKey', - 'recordedAs' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'composer' => ['Organization', 'Person'], - 'firstPerformance' => ['Event'], - 'includedComposition' => ['MusicComposition'], - 'iswcCode' => ['Text'], - 'lyricist' => ['Person'], - 'lyrics' => ['CreativeWork'], - 'musicArrangement' => ['MusicComposition'], - 'musicCompositionForm' => ['Text'], - 'musicalKey' => ['Text'], - 'recordedAs' => ['MusicRecording'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'firstPerformance' => 'The date and place the work was first performed.', - 'includedComposition' => 'Smaller compositions included in this work (e.g. a movement in a symphony).', - 'iswcCode' => 'The International Standard Musical Work Code for the composition.', - 'lyricist' => 'The person who wrote the words.', - 'lyrics' => 'The words in the song.', - 'musicArrangement' => 'An arrangement derived from the composition.', - 'musicCompositionForm' => 'The type of composition (e.g. overture, sonata, symphony, etc.).', - 'musicalKey' => 'The key, mode, or scale this composition uses.', - 'recordedAs' => 'An audio recording of the work. Inverse property: recordingOf.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * The date and place the work was first performed. - * - * @var Event [schema.org types: Event] - */ - public $firstPerformance; - /** - * Smaller compositions included in this work (e.g. a movement in a symphony). - * - * @var MusicComposition [schema.org types: MusicComposition] - */ - public $includedComposition; - /** - * The International Standard Musical Work Code for the composition. - * - * @var string [schema.org types: Text] - */ - public $iswcCode; - /** - * The person who wrote the words. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $lyricist; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'firstPerformance' => 'The date and place the work was first performed.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'includedComposition' => 'Smaller compositions included in this work (e.g. a movement in a symphony).', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'iswcCode' => 'The International Standard Musical Work Code for the composition.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'lyricist' => 'The person who wrote the words.', + 'lyrics' => 'The words in the song.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicArrangement' => 'An arrangement derived from the composition.', + 'musicCompositionForm' => 'The type of composition (e.g. overture, sonata, symphony, etc.).', + 'musicalKey' => 'The key, mode, or scale this composition uses.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAs' => 'An audio recording of the work.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The words in the song. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $lyrics; /** - * An arrangement derived from the composition. - * - * @var MusicComposition [schema.org types: MusicComposition] - */ - public $musicArrangement; - /** - * The type of composition (e.g. overture, sonata, symphony, etc.). - * - * @var string [schema.org types: Text] - */ - public $musicCompositionForm; - /** - * The key, mode, or scale this composition uses. - * - * @var string [schema.org types: Text] - */ - public $musicalKey; - /** - * An audio recording of the work. Inverse property: recordingOf. - * - * @var MusicRecording [schema.org types: MusicRecording] + * @inheritdoc */ - public $recordedAs; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['composer', 'firstPerformance', 'includedComposition', 'iswcCode', 'lyricist', 'lyrics', 'musicArrangement', 'musicCompositionForm', 'musicalKey', 'recordedAs'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicCompositionInterface.php b/src/models/jsonld/MusicCompositionInterface.php new file mode 100644 index 000000000..e5cb63a65 --- /dev/null +++ b/src/models/jsonld/MusicCompositionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicEventInterface.php b/src/models/jsonld/MusicEventInterface.php new file mode 100644 index 000000000..10cb1fb25 --- /dev/null +++ b/src/models/jsonld/MusicEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'album' => ['MusicAlbum'], + 'albums' => ['MusicAlbum'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'musicGroupMember' => ['Person'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'track' => ['ItemList', 'MusicRecording'], + 'tracks' => ['MusicRecording'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'album', - 'genre', - 'track' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'album' => ['MusicAlbum'], - 'genre' => ['Text', 'URL'], - 'track' => ['ItemList', 'MusicRecording'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'album' => 'A music album. Supersedes albums.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'track' => 'A music recording (track)—usually a single song. If an ItemList is given, the list should contain items of type MusicRecording. Supersedes tracks.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'album' => 'A music album.', + 'albums' => 'A collection of music albums.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'musicGroupMember' => 'A member of a music group—for example, John, Paul, George, or Ringo.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'track' => 'A music recording (track)—usually a single song. If an ItemList is given, the list should contain items of type MusicRecording.', + 'tracks' => 'A music recording (track)—usually a single song.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A music album. Supersedes albums. - * - * @var MusicAlbum [schema.org types: MusicAlbum] - */ - public $album; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; /** - * A music recording (track)—usually a single song. If an ItemList is given, - * the list should contain items of type MusicRecording. Supersedes tracks. - * - * @var mixed|ItemList|MusicRecording [schema.org types: ItemList, MusicRecording] + * @inheritdoc */ - public $track; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['album', 'genre', 'track'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicGroupInterface.php b/src/models/jsonld/MusicGroupInterface.php new file mode 100644 index 000000000..83363f93e --- /dev/null +++ b/src/models/jsonld/MusicGroupInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numTracks' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'track' => ['ItemList', 'MusicRecording'], + 'tracks' => ['MusicRecording'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'numTracks', - 'track' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'numTracks' => ['Integer'], - 'track' => ['ItemList', 'MusicRecording'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numTracks' => 'The number of tracks in this album or playlist.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'track' => 'A music recording (track)—usually a single song. If an ItemList is given, the list should contain items of type MusicRecording.', + 'tracks' => 'A music recording (track)—usually a single song.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'numTracks' => 'The number of tracks in this album or playlist.', - 'track' => 'A music recording (track)—usually a single song. If an ItemList is given, the list should contain items of type MusicRecording. Supersedes tracks.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of tracks in this album or playlist. - * - * @var int [schema.org types: Integer] - */ - public $numTracks; - /** - * A music recording (track)—usually a single song. If an ItemList is given, - * the list should contain items of type MusicRecording. Supersedes tracks. - * - * @var mixed|ItemList|MusicRecording [schema.org types: ItemList, MusicRecording] + * @inheritdoc */ - public $track; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['numTracks', 'track'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicPlaylistInterface.php b/src/models/jsonld/MusicPlaylistInterface.php new file mode 100644 index 000000000..682bd8856 --- /dev/null +++ b/src/models/jsonld/MusicPlaylistInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'byArtist' => ['Person', 'MusicGroup'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inAlbum' => ['MusicAlbum'], + 'inLanguage' => ['Text', 'Language'], + 'inPlaylist' => ['MusicPlaylist'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'isrcCode' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'recordingOf' => ['MusicComposition'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'byArtist', - 'duration', - 'inAlbum', - 'inPlaylist', - 'isrcCode', - 'recordingOf' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'byArtist' => ['MusicGroup', 'Person'], - 'duration' => ['Duration'], - 'inAlbum' => ['MusicAlbum'], - 'inPlaylist' => ['MusicPlaylist'], - 'isrcCode' => ['Text'], - 'recordingOf' => ['MusicComposition'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'byArtist' => 'The artist that performed this album or recording.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'inAlbum' => 'The album to which this recording belongs.', - 'inPlaylist' => 'The playlist to which this recording belongs.', - 'isrcCode' => 'The International Standard Recording Code for the recording.', - 'recordingOf' => 'The composition this track is a recording of. Inverse property: recordedAs.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The artist that performed this album or recording. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] + * @inheritdoc */ - public $byArtist; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'byArtist' => 'The artist that performed this album or recording.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inAlbum' => 'The album to which this recording belongs.', + '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]].', + 'inPlaylist' => 'The playlist to which this recording belongs.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'isrcCode' => 'The International Standard Recording Code for the recording.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'recordingOf' => 'The composition this track is a recording of.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; /** - * The album to which this recording belongs. - * - * @var MusicAlbum [schema.org types: MusicAlbum] - */ - public $inAlbum; - /** - * The playlist to which this recording belongs. - * - * @var MusicPlaylist [schema.org types: MusicPlaylist] - */ - public $inPlaylist; - /** - * The International Standard Recording Code for the recording. - * - * @var string [schema.org types: Text] - */ - public $isrcCode; - /** - * The composition this track is a recording of. Inverse property: recordedAs. - * - * @var MusicComposition [schema.org types: MusicComposition] + * @inheritdoc */ - public $recordingOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['byArtist', 'duration', 'inAlbum', 'inPlaylist', 'isrcCode', 'recordingOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicRecordingInterface.php b/src/models/jsonld/MusicRecordingInterface.php new file mode 100644 index 000000000..74f4ca70f --- /dev/null +++ b/src/models/jsonld/MusicRecordingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'catalogNumber' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'creditedTo' => ['Person', 'Organization'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicReleaseFormat' => ['MusicReleaseFormatType'], + 'name' => ['Text'], + 'numTracks' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordLabel' => ['Organization'], + 'recordedAt' => ['Event'], + 'releaseOf' => ['MusicAlbum'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'track' => ['ItemList', 'MusicRecording'], + 'tracks' => ['MusicRecording'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'catalogNumber', - 'creditedTo', - 'duration', - 'musicReleaseFormat', - 'recordLabel', - 'releaseOf' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'catalogNumber' => ['Text'], - 'creditedTo' => ['Organization', 'Person'], - 'duration' => ['Duration'], - 'musicReleaseFormat' => ['MusicReleaseFormatType'], - 'recordLabel' => ['Organization'], - 'releaseOf' => ['MusicAlbum'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'catalogNumber' => 'The catalog number for the release.', - 'creditedTo' => 'The group the release is credited to if different than the byArtist. For example, Red and Blue is credited to "Stefani Germanotta Band", but by Lady Gaga.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'musicReleaseFormat' => 'Format of this release (the type of recording media used, ie. compact disc, digital media, LP, etc.).', - 'recordLabel' => 'The label that issued the release.', - 'releaseOf' => 'The album this is a release of. Inverse property: albumRelease.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The catalog number for the release. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $catalogNumber; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'catalogNumber' => 'The catalog number for the release.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'creditedTo' => 'The group the release is credited to if different than the byArtist. For example, Red and Blue is credited to "Stefani Germanotta Band", but by Lady Gaga.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicReleaseFormat' => 'Format of this release (the type of recording media used, ie. compact disc, digital media, LP, etc.).', + 'name' => 'The name of the item.', + 'numTracks' => 'The number of tracks in this album or playlist.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordLabel' => 'The label that issued the release.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releaseOf' => 'The album this is a release of.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'track' => 'A music recording (track)—usually a single song. If an ItemList is given, the list should contain items of type MusicRecording.', + 'tracks' => 'A music recording (track)—usually a single song.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The group the release is credited to if different than the byArtist. For - * example, Red and Blue is credited to "Stefani Germanotta Band", but by Lady - * Gaga. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creditedTo; /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * Format of this release (the type of recording media used, ie. compact disc, - * digital media, LP, etc.). - * - * @var MusicReleaseFormatType [schema.org types: MusicReleaseFormatType] - */ - public $musicReleaseFormat; - /** - * The label that issued the release. - * - * @var Organization [schema.org types: Organization] - */ - public $recordLabel; - /** - * The album this is a release of. Inverse property: albumRelease. - * - * @var MusicAlbum [schema.org types: MusicAlbum] + * @inheritdoc */ - public $releaseOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['catalogNumber', 'creditedTo', 'duration', 'musicReleaseFormat', 'recordLabel', 'releaseOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicReleaseFormatType.php b/src/models/jsonld/MusicReleaseFormatType.php index cc4557853..ac04ea4a2 100644 --- a/src/models/jsonld/MusicReleaseFormatType.php +++ b/src/models/jsonld/MusicReleaseFormatType.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicReleaseFormatTypeInterface.php b/src/models/jsonld/MusicReleaseFormatTypeInterface.php new file mode 100644 index 000000000..9b3bb5f3c --- /dev/null +++ b/src/models/jsonld/MusicReleaseFormatTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicStoreInterface.php b/src/models/jsonld/MusicStoreInterface.php new file mode 100644 index 000000000..34e48b433 --- /dev/null +++ b/src/models/jsonld/MusicStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicVenueInterface.php b/src/models/jsonld/MusicVenueInterface.php new file mode 100644 index 000000000..9f4af32c8 --- /dev/null +++ b/src/models/jsonld/MusicVenueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedArticle', - 'bitrate', - 'contentSize', - 'contentUrl', - 'duration', - 'embedUrl', - 'encodesCreativeWork', - 'encodingFormat', - 'endTime', - 'height', - 'playerType', - 'productionCompany', - 'regionsAllowed', - 'requiresSubscription', - 'startTime', - 'uploadDate', - 'width' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedArticle' => ['NewsArticle'], - 'bitrate' => ['Text'], - 'contentSize' => ['Text'], - 'contentUrl' => ['URL'], - 'duration' => ['Duration'], - 'embedUrl' => ['URL'], - 'encodesCreativeWork' => ['CreativeWork'], - 'encodingFormat' => ['Text', 'URL'], - 'endTime' => ['DateTime', 'Time'], - 'height' => ['Distance', 'QuantitativeValue'], - 'playerType' => ['Text'], - 'productionCompany' => ['Organization'], - 'regionsAllowed' => ['Place'], - 'requiresSubscription' => ['Boolean', 'MediaSubscription'], - 'startTime' => ['DateTime', 'Time'], - 'uploadDate' => ['Date'], - 'width' => ['Distance', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedArticle' => 'A NewsArticle associated with the Media Object.', - 'bitrate' => 'The bitrate of the media object.', - 'contentSize' => 'File size in (mega/kilo) bytes.', - 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the src element of an embed tag and should not be the same as the content of the loc tag.', - 'encodesCreativeWork' => 'The CreativeWork encoded by this media object. Inverse property: encoding.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'height' => 'The height of the item. The height of the item.', - 'playerType' => 'Player type required—for example, Flash or Silverlight.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in ISO 3166 format.', - 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are true or false (note that an earlier version had \'yes\', \'no\').', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'uploadDate' => 'Date when this media object was uploaded to this site.', - 'width' => 'The width of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A NewsArticle associated with the Media Object. - * - * @var NewsArticle [schema.org types: NewsArticle] - */ - public $associatedArticle; - /** - * The bitrate of the media object. - * - * @var string [schema.org types: Text] - */ - public $bitrate; - /** - * File size in (mega/kilo) bytes. - * - * @var string [schema.org types: Text] - */ - public $contentSize; - /** - * Actual bytes of the media object, for example the image file or video file. - * - * @var string [schema.org types: URL] - */ - public $contentUrl; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * A URL pointing to a player for a specific video. In general, this is the - * information in the src element of an embed tag and should not be the same - * as the content of the loc tag. - * - * @var string [schema.org types: URL] - */ - public $embedUrl; - /** - * The CreativeWork encoded by this media object. Inverse property: encoding. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $encodesCreativeWork; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * The height of the item. The height of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] - */ - public $height; - /** - * Player type required—for example, Flash or Silverlight. - * - * @var string [schema.org types: Text] - */ - public $playerType; - /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] + * @inheritdoc */ - public $productionCompany; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The regions where the media is allowed. If not specified, then it's assumed - * to be allowed everywhere. Specify the countries in ISO 3166 format. - * - * @var Place [schema.org types: Place] - */ - public $regionsAllowed; - /** - * Indicates if use of the media require a subscription (either paid or free). - * Allowed values are true or false (note that an earlier version had 'yes', - * 'no'). - * - * @var mixed|bool|MediaSubscription [schema.org types: Boolean, MediaSubscription] - */ - public $requiresSubscription; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; - /** - * Date when this media object was uploaded to this site. - * - * @var Date [schema.org types: Date] - */ - public $uploadDate; /** - * The width of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] + * @inheritdoc */ - public $width; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedArticle', 'bitrate', 'contentSize', 'contentUrl', 'duration', 'embedUrl', 'encodesCreativeWork', 'encodingFormat', 'endTime', 'height', 'playerType', 'productionCompany', 'regionsAllowed', 'requiresSubscription', 'startTime', 'uploadDate', 'width'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/MusicVideoObjectInterface.php b/src/models/jsonld/MusicVideoObjectInterface.php new file mode 100644 index 000000000..f5f04f44c --- /dev/null +++ b/src/models/jsonld/MusicVideoObjectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NGOInterface.php b/src/models/jsonld/NGOInterface.php new file mode 100644 index 000000000..65a68e010 --- /dev/null +++ b/src/models/jsonld/NGOInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/NLNonprofitTypeInterface.php b/src/models/jsonld/NLNonprofitTypeInterface.php new file mode 100644 index 000000000..7c5e1f567 --- /dev/null +++ b/src/models/jsonld/NLNonprofitTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NailSalonInterface.php b/src/models/jsonld/NailSalonInterface.php new file mode 100644 index 000000000..e7b1453fd --- /dev/null +++ b/src/models/jsonld/NailSalonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/NarcoticConsiderationInterface.php b/src/models/jsonld/NarcoticConsiderationInterface.php new file mode 100644 index 000000000..aa6cc5abe --- /dev/null +++ b/src/models/jsonld/NarcoticConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NeckInterface.php b/src/models/jsonld/NeckInterface.php new file mode 100644 index 000000000..4a8bad90b --- /dev/null +++ b/src/models/jsonld/NeckInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'bodyLocation' => ['Text'], + 'branch' => ['AnatomicalStructure'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'nerveMotor' => ['Muscle'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'sensoryUnit' => ['SuperficialAnatomy', 'AnatomicalStructure'], + 'sourcedFrom' => ['BrainStructure'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'nerveMotor', - 'sensoryUnit', - 'sourcedFrom' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'nerveMotor' => ['Muscle'], - 'sensoryUnit' => ['AnatomicalStructure', 'SuperficialAnatomy'], - 'sourcedFrom' => ['BrainStructure'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'nerveMotor' => 'The neurological pathway extension that involves muscle control.', - 'sensoryUnit' => 'The neurological pathway extension that inputs and sends information to the brain or spinal cord.', - 'sourcedFrom' => 'The neurological pathway that originates the neurons.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'branch' => 'The branches that delineate from the nerve bundle. Not to be confused with [[branchOf]].', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'nerveMotor' => 'The neurological pathway extension that involves muscle control.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'sensoryUnit' => 'The neurological pathway extension that inputs and sends information to the brain or spinal cord.', + 'sourcedFrom' => 'The neurological pathway that originates the neurons.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The neurological pathway extension that involves muscle control. - * - * @var Muscle [schema.org types: Muscle] - */ - public $nerveMotor; - /** - * The neurological pathway extension that inputs and sends information to the - * brain or spinal cord. - * - * @var mixed|AnatomicalStructure|SuperficialAnatomy [schema.org types: AnatomicalStructure, SuperficialAnatomy] - */ - public $sensoryUnit; /** - * The neurological pathway that originates the neurons. - * - * @var BrainStructure [schema.org types: BrainStructure] + * @inheritdoc */ - public $sourcedFrom; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['nerveMotor', 'sensoryUnit', 'sourcedFrom'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NerveInterface.php b/src/models/jsonld/NerveInterface.php new file mode 100644 index 000000000..9f699e93e --- /dev/null +++ b/src/models/jsonld/NerveInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NeuroInterface.php b/src/models/jsonld/NeuroInterface.php new file mode 100644 index 000000000..356951f57 --- /dev/null +++ b/src/models/jsonld/NeuroInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NeurologicInterface.php b/src/models/jsonld/NeurologicInterface.php new file mode 100644 index 000000000..2b5263055 --- /dev/null +++ b/src/models/jsonld/NeurologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NewConditionInterface.php b/src/models/jsonld/NewConditionInterface.php new file mode 100644 index 000000000..5cc6ba0f2 --- /dev/null +++ b/src/models/jsonld/NewConditionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dateline' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'printColumn' => ['Text'], + 'printEdition' => ['Text'], + 'printPage' => ['Text'], + 'printSection' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dateline', - 'printColumn', - 'printEdition', - 'printPage', - 'printSection' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dateline' => ['Text'], - 'printColumn' => ['Text'], - 'printEdition' => ['Text'], - 'printPage' => ['Text'], - 'printSection' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dateline' => 'A dateline is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using locationCreated (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use contentLocation. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines".', - 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', - 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', - 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', - 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - 'author', - 'datePublished', - 'headline', - 'image', - 'publisher' - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - 'dateModified', - 'mainEntityOfPage' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dateline' => 'A [dateline](https://en.wikipedia.org/wiki/Dateline) is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using [[locationCreated]] (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use [[contentLocation]]. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines". ', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', + 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', + 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', + 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A dateline is a brief piece of text included in news articles that - * describes where and when the story was written or filed though the date is - * often omitted. Sometimes only a placename is provided. Structured - * representations of dateline-related information can also be expressed more - * explicitly using locationCreated (which represents where a work was created - * e.g. where a news report was written). For location depicted or described - * in the content, use contentLocation. Dateline summaries are oriented more - * towards human readers than towards automated processing, and can vary - * substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", - * "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", - * "QUEZON CITY, Philippines". - * - * @var string [schema.org types: Text] - */ - public $dateline; - /** - * The number of the column in which the NewsArticle appears in the print - * edition. - * - * @var string [schema.org types: Text] - */ - public $printColumn; - /** - * The edition of the print product in which the NewsArticle appears. - * - * @var string [schema.org types: Text] - */ - public $printEdition; - /** - * If this NewsArticle appears in print, this field indicates the name of the - * page on which the article is found. Please note that this field is intended - * for the exact page name (e.g. A5, B18). - * - * @var string [schema.org types: Text] - */ - public $printPage; - /** - * If this NewsArticle appears in print, this field indicates the print - * section in which the article appeared. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $printSection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dateline', 'printColumn', 'printEdition', 'printPage', 'printSection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NewsArticleInterface.php b/src/models/jsonld/NewsArticleInterface.php new file mode 100644 index 000000000..eb5c57926 --- /dev/null +++ b/src/models/jsonld/NewsArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'masthead' => ['URL', 'CreativeWork'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'missionCoveragePrioritiesPolicy' => ['CreativeWork', 'URL'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'noBylinesPolicy' => ['CreativeWork', 'URL'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'], + 'verificationFactCheckingPolicy' => ['URL', 'CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'correctionsPolicy', - 'diversityPolicy', - 'diversityStaffingReport', - 'ethicsPolicy', - 'masthead', - 'missionCoveragePrioritiesPolicy', - 'noBylinesPolicy', - 'ownershipFundingInfo', - 'unnamedSourcesPolicy', - 'verificationFactCheckingPolicy' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'masthead' => ['CreativeWork', 'URL'], - 'missionCoveragePrioritiesPolicy' => ['CreativeWork', 'URL'], - 'noBylinesPolicy' => ['CreativeWork', 'URL'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'verificationFactCheckingPolicy' => ['CreativeWork', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'masthead' => 'For a NewsMediaOrganization, a link to the masthead page or a page listing top editorial management.', - 'missionCoveragePrioritiesPolicy' => 'For a NewsMediaOrganization, a statement on coverage priorities, including any public agenda or stance on issues.', - 'noBylinesPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement explaining when authors of articles are not named in bylines.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'verificationFactCheckingPolicy' => 'Disclosure about verification and fact-checking processes for a NewsMediaOrganization or other fact-checking Organization.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * For a NewsMediaOrganization, a link to the masthead page or a page listing - * top editorial management. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $masthead; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'masthead' => 'For a [[NewsMediaOrganization]], a link to the masthead page or a page listing top editorial management.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'missionCoveragePrioritiesPolicy' => 'For a [[NewsMediaOrganization]], a statement on coverage priorities, including any public agenda or stance on issues.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'noBylinesPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement explaining when authors of articles are not named in bylines.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.', + 'verificationFactCheckingPolicy' => 'Disclosure about verification and fact-checking processes for a [[NewsMediaOrganization]] or other fact-checking [[Organization]].' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * For a NewsMediaOrganization, a statement on coverage priorities, including - * any public agenda or stance on issues. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $missionCoveragePrioritiesPolicy; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * explaining when authors of articles are not named in bylines. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $noBylinesPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; /** - * Disclosure about verification and fact-checking processes for a - * NewsMediaOrganization or other fact-checking Organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $verificationFactCheckingPolicy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'correctionsPolicy', 'diversityPolicy', 'diversityStaffingReport', 'ethicsPolicy', 'masthead', 'missionCoveragePrioritiesPolicy', 'noBylinesPolicy', 'ownershipFundingInfo', 'unnamedSourcesPolicy', 'verificationFactCheckingPolicy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NewsMediaOrganizationInterface.php b/src/models/jsonld/NewsMediaOrganizationInterface.php new file mode 100644 index 000000000..5b7961ecb --- /dev/null +++ b/src/models/jsonld/NewsMediaOrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'endDate', - 'issn', - 'startDate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'endDate' => ['Date', 'DateTime'], - 'issn' => ['Text'], - 'startDate' => ['Date', 'DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The International Standard Serial Number (ISSN) that identifies this serial - * publication. You can repeat this property to identify different formats of, - * or the linking ISSN (ISSN-L) for, this serial publication. - * - * @var string [schema.org types: Text] - */ - public $issn; /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $startDate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['endDate', 'issn', 'startDate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NewspaperInterface.php b/src/models/jsonld/NewspaperInterface.php new file mode 100644 index 000000000..3fad58634 --- /dev/null +++ b/src/models/jsonld/NewspaperInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NightClubInterface.php b/src/models/jsonld/NightClubInterface.php new file mode 100644 index 000000000..5a481ac08 --- /dev/null +++ b/src/models/jsonld/NightClubInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NoninvasiveProcedureInterface.php b/src/models/jsonld/NoninvasiveProcedureInterface.php new file mode 100644 index 000000000..2cbc2f503 --- /dev/null +++ b/src/models/jsonld/NoninvasiveProcedureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501aInterface.php b/src/models/jsonld/Nonprofit501aInterface.php new file mode 100644 index 000000000..dfe2a40f9 --- /dev/null +++ b/src/models/jsonld/Nonprofit501aInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c10.php b/src/models/jsonld/Nonprofit501c10.php new file mode 100644 index 000000000..5ad027e01 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c10.php @@ -0,0 +1,152 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c10Interface.php b/src/models/jsonld/Nonprofit501c10Interface.php new file mode 100644 index 000000000..b14d14baf --- /dev/null +++ b/src/models/jsonld/Nonprofit501c10Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c11Interface.php b/src/models/jsonld/Nonprofit501c11Interface.php new file mode 100644 index 000000000..e6fbfc50e --- /dev/null +++ b/src/models/jsonld/Nonprofit501c11Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c12Interface.php b/src/models/jsonld/Nonprofit501c12Interface.php new file mode 100644 index 000000000..28d2756fa --- /dev/null +++ b/src/models/jsonld/Nonprofit501c12Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c13Interface.php b/src/models/jsonld/Nonprofit501c13Interface.php new file mode 100644 index 000000000..55934855a --- /dev/null +++ b/src/models/jsonld/Nonprofit501c13Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c14Interface.php b/src/models/jsonld/Nonprofit501c14Interface.php new file mode 100644 index 000000000..234610acb --- /dev/null +++ b/src/models/jsonld/Nonprofit501c14Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c15Interface.php b/src/models/jsonld/Nonprofit501c15Interface.php new file mode 100644 index 000000000..315d2f074 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c15Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c16Interface.php b/src/models/jsonld/Nonprofit501c16Interface.php new file mode 100644 index 000000000..2b5619bff --- /dev/null +++ b/src/models/jsonld/Nonprofit501c16Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c17Interface.php b/src/models/jsonld/Nonprofit501c17Interface.php new file mode 100644 index 000000000..3cfce1f88 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c17Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c18Interface.php b/src/models/jsonld/Nonprofit501c18Interface.php new file mode 100644 index 000000000..3a652ece1 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c18Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c19Interface.php b/src/models/jsonld/Nonprofit501c19Interface.php new file mode 100644 index 000000000..a2b92d894 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c19Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c20.php b/src/models/jsonld/Nonprofit501c20.php new file mode 100644 index 000000000..461f06659 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c20.php @@ -0,0 +1,152 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c20Interface.php b/src/models/jsonld/Nonprofit501c20Interface.php new file mode 100644 index 000000000..d7de5a0c7 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c20Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c21Interface.php b/src/models/jsonld/Nonprofit501c21Interface.php new file mode 100644 index 000000000..5746fca87 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c21Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c22Interface.php b/src/models/jsonld/Nonprofit501c22Interface.php new file mode 100644 index 000000000..0c9cd8e43 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c22Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c23Interface.php b/src/models/jsonld/Nonprofit501c23Interface.php new file mode 100644 index 000000000..c1b4a1cfa --- /dev/null +++ b/src/models/jsonld/Nonprofit501c23Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c24Interface.php b/src/models/jsonld/Nonprofit501c24Interface.php new file mode 100644 index 000000000..181ef042d --- /dev/null +++ b/src/models/jsonld/Nonprofit501c24Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c25Interface.php b/src/models/jsonld/Nonprofit501c25Interface.php new file mode 100644 index 000000000..8f5f02fd4 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c25Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c26Interface.php b/src/models/jsonld/Nonprofit501c26Interface.php new file mode 100644 index 000000000..c9095f29f --- /dev/null +++ b/src/models/jsonld/Nonprofit501c26Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c27Interface.php b/src/models/jsonld/Nonprofit501c27Interface.php new file mode 100644 index 000000000..33255c7c6 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c27Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c28Interface.php b/src/models/jsonld/Nonprofit501c28Interface.php new file mode 100644 index 000000000..5ce32e49e --- /dev/null +++ b/src/models/jsonld/Nonprofit501c28Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c3Interface.php b/src/models/jsonld/Nonprofit501c3Interface.php new file mode 100644 index 000000000..7ef037ad4 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c3Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c4Interface.php b/src/models/jsonld/Nonprofit501c4Interface.php new file mode 100644 index 000000000..89ce23ac7 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c4Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c5Interface.php b/src/models/jsonld/Nonprofit501c5Interface.php new file mode 100644 index 000000000..eaf4fa4ac --- /dev/null +++ b/src/models/jsonld/Nonprofit501c5Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c6Interface.php b/src/models/jsonld/Nonprofit501c6Interface.php new file mode 100644 index 000000000..da25d5479 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c6Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c7Interface.php b/src/models/jsonld/Nonprofit501c7Interface.php new file mode 100644 index 000000000..05243c587 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c7Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c8Interface.php b/src/models/jsonld/Nonprofit501c8Interface.php new file mode 100644 index 000000000..b9fe78899 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c8Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501c9Interface.php b/src/models/jsonld/Nonprofit501c9Interface.php new file mode 100644 index 000000000..ba0267885 --- /dev/null +++ b/src/models/jsonld/Nonprofit501c9Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501dInterface.php b/src/models/jsonld/Nonprofit501dInterface.php new file mode 100644 index 000000000..d8747f501 --- /dev/null +++ b/src/models/jsonld/Nonprofit501dInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501eInterface.php b/src/models/jsonld/Nonprofit501eInterface.php new file mode 100644 index 000000000..a702b4cfa --- /dev/null +++ b/src/models/jsonld/Nonprofit501eInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501fInterface.php b/src/models/jsonld/Nonprofit501fInterface.php new file mode 100644 index 000000000..8a6eb9aec --- /dev/null +++ b/src/models/jsonld/Nonprofit501fInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501kInterface.php b/src/models/jsonld/Nonprofit501kInterface.php new file mode 100644 index 000000000..54e1a4b03 --- /dev/null +++ b/src/models/jsonld/Nonprofit501kInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501nInterface.php b/src/models/jsonld/Nonprofit501nInterface.php new file mode 100644 index 000000000..fbe9e244b --- /dev/null +++ b/src/models/jsonld/Nonprofit501nInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit501qInterface.php b/src/models/jsonld/Nonprofit501qInterface.php new file mode 100644 index 000000000..75e039982 --- /dev/null +++ b/src/models/jsonld/Nonprofit501qInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Nonprofit527Interface.php b/src/models/jsonld/Nonprofit527Interface.php new file mode 100644 index 000000000..88da0fa95 --- /dev/null +++ b/src/models/jsonld/Nonprofit527Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/NonprofitANBIInterface.php b/src/models/jsonld/NonprofitANBIInterface.php new file mode 100644 index 000000000..edcd8db2b --- /dev/null +++ b/src/models/jsonld/NonprofitANBIInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/NonprofitSBBIInterface.php b/src/models/jsonld/NonprofitSBBIInterface.php new file mode 100644 index 000000000..3067c0f59 --- /dev/null +++ b/src/models/jsonld/NonprofitSBBIInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/NonprofitTypeInterface.php b/src/models/jsonld/NonprofitTypeInterface.php new file mode 100644 index 000000000..b72539c13 --- /dev/null +++ b/src/models/jsonld/NonprofitTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NoseInterface.php b/src/models/jsonld/NoseInterface.php new file mode 100644 index 000000000..4dcaed351 --- /dev/null +++ b/src/models/jsonld/NoseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NotInForceInterface.php b/src/models/jsonld/NotInForceInterface.php new file mode 100644 index 000000000..17f5c3038 --- /dev/null +++ b/src/models/jsonld/NotInForceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NotYetRecruitingInterface.php b/src/models/jsonld/NotYetRecruitingInterface.php new file mode 100644 index 000000000..e9cade9e1 --- /dev/null +++ b/src/models/jsonld/NotYetRecruitingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NotaryInterface.php b/src/models/jsonld/NotaryInterface.php new file mode 100644 index 000000000..7306acf5f --- /dev/null +++ b/src/models/jsonld/NotaryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'hasDigitalDocumentPermission' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A permission related to the access to this document (e.g. permission to - * read or write an electronic document). For a public document, specify a - * grantee with an Audience with audienceType equal to "public". - * - * @var DigitalDocumentPermission [schema.org types: DigitalDocumentPermission] + * @inheritdoc */ - public $hasDigitalDocumentPermission; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasDigitalDocumentPermission'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NoteDigitalDocumentInterface.php b/src/models/jsonld/NoteDigitalDocumentInterface.php new file mode 100644 index 000000000..62702ea1c --- /dev/null +++ b/src/models/jsonld/NoteDigitalDocumentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NumberInterface.php b/src/models/jsonld/NumberInterface.php new file mode 100644 index 000000000..8f6975b4d --- /dev/null +++ b/src/models/jsonld/NumberInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NursingInterface.php b/src/models/jsonld/NursingInterface.php new file mode 100644 index 000000000..4479e6d57 --- /dev/null +++ b/src/models/jsonld/NursingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'calories' => ['Energy'], + 'carbohydrateContent' => ['Mass'], + 'cholesterolContent' => ['Mass'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'fatContent' => ['Mass'], + 'fiberContent' => ['Mass'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'proteinContent' => ['Mass'], + 'sameAs' => ['URL'], + 'saturatedFatContent' => ['Mass'], + 'servingSize' => ['Text'], + 'sodiumContent' => ['Mass'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'sugarContent' => ['Mass'], + 'transFatContent' => ['Mass'], + 'unsaturatedFatContent' => ['Mass'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'calories', - 'carbohydrateContent', - 'cholesterolContent', - 'fatContent', - 'fiberContent', - 'proteinContent', - 'saturatedFatContent', - 'servingSize', - 'sodiumContent', - 'sugarContent', - 'transFatContent', - 'unsaturatedFatContent' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'calories' => ['Energy'], - 'carbohydrateContent' => ['Mass'], - 'cholesterolContent' => ['Mass'], - 'fatContent' => ['Mass'], - 'fiberContent' => ['Mass'], - 'proteinContent' => ['Mass'], - 'saturatedFatContent' => ['Mass'], - 'servingSize' => ['Text'], - 'sodiumContent' => ['Mass'], - 'sugarContent' => ['Mass'], - 'transFatContent' => ['Mass'], - 'unsaturatedFatContent' => ['Mass'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'calories' => 'The number of calories.', - 'carbohydrateContent' => 'The number of grams of carbohydrates.', - 'cholesterolContent' => 'The number of milligrams of cholesterol.', - 'fatContent' => 'The number of grams of fat.', - 'fiberContent' => 'The number of grams of fiber.', - 'proteinContent' => 'The number of grams of protein.', - 'saturatedFatContent' => 'The number of grams of saturated fat.', - 'servingSize' => 'The serving size, in terms of the number of volume or mass.', - 'sodiumContent' => 'The number of milligrams of sodium.', - 'sugarContent' => 'The number of grams of sugar.', - 'transFatContent' => 'The number of grams of trans fat.', - 'unsaturatedFatContent' => 'The number of grams of unsaturated fat.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of calories. - * - * @var Energy [schema.org types: Energy] - */ - public $calories; /** - * The number of grams of carbohydrates. - * - * @var Mass [schema.org types: Mass] - */ - public $carbohydrateContent; - /** - * The number of milligrams of cholesterol. - * - * @var Mass [schema.org types: Mass] - */ - public $cholesterolContent; - /** - * The number of grams of fat. - * - * @var Mass [schema.org types: Mass] - */ - public $fatContent; - /** - * The number of grams of fiber. - * - * @var Mass [schema.org types: Mass] - */ - public $fiberContent; - /** - * The number of grams of protein. - * - * @var Mass [schema.org types: Mass] - */ - public $proteinContent; - /** - * The number of grams of saturated fat. - * - * @var Mass [schema.org types: Mass] + * @inheritdoc */ - public $saturatedFatContent; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'calories' => 'The number of calories.', + 'carbohydrateContent' => 'The number of grams of carbohydrates.', + 'cholesterolContent' => 'The number of milligrams of cholesterol.', + 'description' => 'A description of the item.', + '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.', + 'fatContent' => 'The number of grams of fat.', + 'fiberContent' => 'The number of grams of fiber.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'proteinContent' => 'The number of grams of protein.', + '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.', + 'saturatedFatContent' => 'The number of grams of saturated fat.', + 'servingSize' => 'The serving size, in terms of the number of volume or mass.', + 'sodiumContent' => 'The number of milligrams of sodium.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'sugarContent' => 'The number of grams of sugar.', + 'transFatContent' => 'The number of grams of trans fat.', + 'unsaturatedFatContent' => 'The number of grams of unsaturated fat.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The serving size, in terms of the number of volume or mass. - * - * @var string [schema.org types: Text] - */ - public $servingSize; - /** - * The number of milligrams of sodium. - * - * @var Mass [schema.org types: Mass] - */ - public $sodiumContent; - /** - * The number of grams of sugar. - * - * @var Mass [schema.org types: Mass] - */ - public $sugarContent; - /** - * The number of grams of trans fat. - * - * @var Mass [schema.org types: Mass] - */ - public $transFatContent; /** - * The number of grams of unsaturated fat. - * - * @var Mass [schema.org types: Mass] + * @inheritdoc */ - public $unsaturatedFatContent; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['calories', 'carbohydrateContent', 'cholesterolContent', 'fatContent', 'fiberContent', 'proteinContent', 'saturatedFatContent', 'servingSize', 'sodiumContent', 'sugarContent', 'transFatContent', 'unsaturatedFatContent'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/NutritionInformationInterface.php b/src/models/jsonld/NutritionInformationInterface.php new file mode 100644 index 000000000..d9ca47072 --- /dev/null +++ b/src/models/jsonld/NutritionInformationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OTCInterface.php b/src/models/jsonld/OTCInterface.php new file mode 100644 index 000000000..709d23aec --- /dev/null +++ b/src/models/jsonld/OTCInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'marginOfError' => ['QuantitativeValue'], + 'measuredProperty' => ['Property'], + 'measuredValue' => ['DataType'], + 'name' => ['Text'], + 'observationDate' => ['DateTime'], + 'observedNode' => ['StatisticalPopulation'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'marginOfError', - 'measuredProperty', - 'measuredValue', - 'observationDate', - 'observedNode' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'marginOfError' => ['DateTime'], - 'measuredProperty' => ['Property'], - 'measuredValue' => ['DataType'], - 'observationDate' => ['DateTime'], - 'observedNode' => ['StatisticalPopulation'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'marginOfError' => 'A marginOfError for an Observation.', - 'measuredProperty' => 'The measuredProperty of an Observation, either a schema.org property, a property from other RDF-compatible systems e.g. W3C RDF Data Cube, or schema.org extensions such as GS1\'s.', - 'measuredValue' => 'The measuredValue of an Observation.', - 'observationDate' => 'The observationDate of an Observation.', - 'observedNode' => 'The observedNode of an Observation, often a StatisticalPopulation.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'marginOfError' => 'A marginOfError for an [[Observation]].', + 'measuredProperty' => 'The measuredProperty of an [[Observation]], either a schema.org property, a property from other RDF-compatible systems e.g. W3C RDF Data Cube, or schema.org extensions such as [GS1\'s](https://www.gs1.org/voc/?show=properties).', + 'measuredValue' => 'The measuredValue of an [[Observation]].', + 'name' => 'The name of the item.', + 'observationDate' => 'The observationDate of an [[Observation]].', + 'observedNode' => 'The observedNode of an [[Observation]], often a [[StatisticalPopulation]].', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A marginOfError for an Observation. - * - * @var DateTime [schema.org types: DateTime] - */ - public $marginOfError; - /** - * The measuredProperty of an Observation, either a schema.org property, a - * property from other RDF-compatible systems e.g. W3C RDF Data Cube, or - * schema.org extensions such as GS1's. - * - * @var Property [schema.org types: Property] - */ - public $measuredProperty; - /** - * The measuredValue of an Observation. - * - * @var DataType [schema.org types: DataType] - */ - public $measuredValue; - /** - * The observationDate of an Observation. - * - * @var DateTime [schema.org types: DateTime] - */ - public $observationDate; - /** - * The observedNode of an Observation, often a StatisticalPopulation. - * - * @var StatisticalPopulation [schema.org types: StatisticalPopulation] + * @inheritdoc */ - public $observedNode; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['marginOfError', 'measuredProperty', 'measuredValue', 'observationDate', 'observedNode'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ObservationInterface.php b/src/models/jsonld/ObservationInterface.php new file mode 100644 index 000000000..c6404eca0 --- /dev/null +++ b/src/models/jsonld/ObservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ObservationalInterface.php b/src/models/jsonld/ObservationalInterface.php new file mode 100644 index 000000000..d110e6a84 --- /dev/null +++ b/src/models/jsonld/ObservationalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ObstetricInterface.php b/src/models/jsonld/ObstetricInterface.php new file mode 100644 index 000000000..7c6f58865 --- /dev/null +++ b/src/models/jsonld/ObstetricInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'educationRequirements' => ['EducationalOccupationalCredential', 'Text'], + 'estimatedSalary' => ['MonetaryAmountDistribution', 'MonetaryAmount', 'Number'], + 'experienceRequirements' => ['Text', 'OccupationalExperienceRequirements'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'occupationLocation' => ['AdministrativeArea'], + 'occupationalCategory' => ['CategoryCode', 'Text'], + 'potentialAction' => ['Action'], + 'qualifications' => ['Text', 'EducationalOccupationalCredential'], + 'responsibilities' => ['Text'], + 'sameAs' => ['URL'], + 'skills' => ['Text', 'DefinedTerm'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'educationRequirements', - 'estimatedSalary', - 'experienceRequirements', - 'occupationLocation', - 'occupationalCategory', - 'qualifications', - 'responsibilities', - 'skills' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'educationRequirements' => ['EducationalOccupationalCredential', 'Text'], - 'estimatedSalary' => ['MonetaryAmount', 'MonetaryAmountDistribution', 'Number'], - 'experienceRequirements' => ['Text'], - 'occupationLocation' => ['AdministrativeArea'], - 'occupationalCategory' => ['CategoryCode', 'Text'], - 'qualifications' => ['EducationalOccupationalCredential', 'Text'], - 'responsibilities' => ['Text'], - 'skills' => ['DefinedTerm', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'educationRequirements' => 'Educational background needed for the position or Occupation.', - 'estimatedSalary' => 'An estimated salary for a job posting or occupation, based on a variety of variables including, but not limited to industry, job title, and location. Estimated salaries are often computed by outside organizations rather than the hiring organization, who may not have committed to the estimated value.', - 'experienceRequirements' => 'Description of skills and experience needed for the position or Occupation.', - 'occupationLocation' => 'The region/country for which this occupational description is appropriate. Note that educational requirements and qualifications can vary between jurisdictions.', - 'occupationalCategory' => 'A category describing the job, preferably using a term from a taxonomy such as BLS O*NET-SOC, ISCO-08 or similar, with the property repeated for each applicable value. Ideally the taxonomy should be identified, and both the textual label and formal code for the category should be provided. Note: for historical reasons, any textual label and formal code provided as a literal may be assumed to be from O*NET-SOC.', - 'qualifications' => 'Specific qualifications required for this role or Occupation.', - 'responsibilities' => 'Responsibilities associated with this role or Occupation.', - 'skills' => 'A statement of knowledge, skill, ability, task or any other assertion expressing a competency that is desired or required to fulfill this role or to work in this occupation.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Educational background needed for the position or Occupation. - * - * @var mixed|EducationalOccupationalCredential|string [schema.org types: EducationalOccupationalCredential, Text] - */ - public $educationRequirements; - /** - * An estimated salary for a job posting or occupation, based on a variety of - * variables including, but not limited to industry, job title, and location. - * Estimated salaries are often computed by outside organizations rather than - * the hiring organization, who may not have committed to the estimated value. - * - * @var mixed|MonetaryAmount|MonetaryAmountDistribution|float [schema.org types: MonetaryAmount, MonetaryAmountDistribution, Number] - */ - public $estimatedSalary; - /** - * Description of skills and experience needed for the position or Occupation. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $experienceRequirements; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'educationRequirements' => 'Educational background needed for the position or Occupation.', + 'estimatedSalary' => 'An estimated salary for a job posting or occupation, based on a variety of variables including, but not limited to industry, job title, and location. Estimated salaries are often computed by outside organizations rather than the hiring organization, who may not have committed to the estimated value.', + 'experienceRequirements' => 'Description of skills and experience needed for the position or Occupation.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'occupationLocation' => ' The region/country for which this occupational description is appropriate. Note that educational requirements and qualifications can vary between jurisdictions.', + 'occupationalCategory' => 'A category describing the job, preferably using a term from a taxonomy such as [BLS O*NET-SOC](http://www.onetcenter.org/taxonomy.html), [ISCO-08](https://www.ilo.org/public/english/bureau/stat/isco/isco08/) or similar, with the property repeated for each applicable value. Ideally the taxonomy should be identified, and both the textual label and formal code for the category should be provided. Note: for historical reasons, any textual label and formal code provided as a literal may be assumed to be from O*NET-SOC.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'qualifications' => 'Specific qualifications required for this role or Occupation.', + 'responsibilities' => 'Responsibilities associated with this role or Occupation.', + '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.', + 'skills' => 'A statement of knowledge, skill, ability, task or any other assertion expressing a competency that is desired or required to fulfill this role or to work in this occupation.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The region/country for which this occupational description is appropriate. - * Note that educational requirements and qualifications can vary between - * jurisdictions. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] - */ - public $occupationLocation; - /** - * A category describing the job, preferably using a term from a taxonomy such - * as BLS O*NET-SOC, ISCO-08 or similar, with the property repeated for each - * applicable value. Ideally the taxonomy should be identified, and both the - * textual label and formal code for the category should be provided. Note: - * for historical reasons, any textual label and formal code provided as a - * literal may be assumed to be from O*NET-SOC. - * - * @var mixed|CategoryCode|string [schema.org types: CategoryCode, Text] - */ - public $occupationalCategory; - /** - * Specific qualifications required for this role or Occupation. - * - * @var mixed|EducationalOccupationalCredential|string [schema.org types: EducationalOccupationalCredential, Text] - */ - public $qualifications; /** - * Responsibilities associated with this role or Occupation. - * - * @var string [schema.org types: Text] - */ - public $responsibilities; - /** - * A statement of knowledge, skill, ability, task or any other assertion - * expressing a competency that is desired or required to fulfill this role or - * to work in this occupation. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] + * @inheritdoc */ - public $skills; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['educationRequirements', 'estimatedSalary', 'experienceRequirements', 'occupationLocation', 'occupationalCategory', 'qualifications', 'responsibilities', 'skills'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OccupationInterface.php b/src/models/jsonld/OccupationInterface.php new file mode 100644 index 000000000..ddffe073c --- /dev/null +++ b/src/models/jsonld/OccupationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OccupationalActivityInterface.php b/src/models/jsonld/OccupationalActivityInterface.php new file mode 100644 index 000000000..56297391a --- /dev/null +++ b/src/models/jsonld/OccupationalActivityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'monthsOfExperience' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'monthsOfExperience' => 'Indicates the minimal number of months of experience required for a position.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/OccupationalExperienceRequirementsInterface.php b/src/models/jsonld/OccupationalExperienceRequirementsInterface.php new file mode 100644 index 000000000..05898b38d --- /dev/null +++ b/src/models/jsonld/OccupationalExperienceRequirementsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'adverseOutcome' => ['MedicalEntity'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'contraindication' => ['Text', 'MedicalContraindication'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseSchedule' => ['DoseSchedule'], + 'drug' => ['Drug'], + 'duplicateTherapy' => ['MedicalTherapy'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'seriousAdverseOutcome' => ['MedicalEntity'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'contraindication', - 'duplicateTherapy', - 'seriousAdverseOutcome' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'contraindication' => ['MedicalContraindication', 'Text'], - 'duplicateTherapy' => ['MedicalTherapy'], - 'seriousAdverseOutcome' => ['MedicalEntity'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'contraindication' => 'A contraindication for this therapy.', - 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', - 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'contraindication' => 'A contraindication for this therapy.', + 'description' => 'A description of the item.', + '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.', + 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A contraindication for this therapy. - * - * @var mixed|MedicalContraindication|string [schema.org types: MedicalContraindication, Text] - */ - public $contraindication; - /** - * A therapy that duplicates or overlaps this one. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $duplicateTherapy; /** - * A possible serious complication and/or serious side effect of this therapy. - * Serious adverse outcomes include those that are life-threatening; result in - * death, disability, or permanent damage; require hospitalization or prolong - * existing hospitalization; cause congenital anomalies or birth defects; or - * jeopardize the patient and may require medical or surgical intervention to - * prevent one of the outcomes in this definition. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $seriousAdverseOutcome; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['contraindication', 'duplicateTherapy', 'seriousAdverseOutcome'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OccupationalTherapyInterface.php b/src/models/jsonld/OccupationalTherapyInterface.php new file mode 100644 index 000000000..e0ce5ab1b --- /dev/null +++ b/src/models/jsonld/OccupationalTherapyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OceanBodyOfWaterInterface.php b/src/models/jsonld/OceanBodyOfWaterInterface.php new file mode 100644 index 000000000..f82d7bf49 --- /dev/null +++ b/src/models/jsonld/OceanBodyOfWaterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptedPaymentMethod' => ['LoanOrCredit', 'PaymentMethod'], + 'addOn' => ['Offer'], + 'additionalType' => ['URL'], + 'advanceBookingRequirement' => ['QuantitativeValue'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availability' => ['ItemAvailability'], + 'availabilityEnds' => ['Date', 'DateTime', 'Time'], + 'availabilityStarts' => ['Time', 'DateTime', 'Date'], + 'availableAtOrFrom' => ['Place'], + 'availableDeliveryMethod' => ['DeliveryMethod'], + 'businessFunction' => ['BusinessFunction'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'deliveryLeadTime' => ['QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleCustomerType' => ['BusinessEntityType'], + 'eligibleDuration' => ['QuantitativeValue'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleRegion' => ['GeoShape', 'Text', 'Place'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includesObject' => ['TypeAndQuantityNode'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'inventoryLevel' => ['QuantitativeValue'], + 'isFamilyFriendly' => ['Boolean'], + 'itemCondition' => ['OfferItemCondition'], + 'itemOffered' => ['Trip', 'Event', 'Product', 'AggregateOffer', 'CreativeWork', 'MenuItem', 'Service'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'offeredBy' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'priceValidUntil' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seller' => ['Organization', 'Person'], + 'serialNumber' => ['Text'], + 'shippingDetails' => ['OfferShippingDetails'], + 'sku' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'warranty' => ['WarrantyPromise'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptedPaymentMethod', - 'addOn', - 'advanceBookingRequirement', - 'aggregateRating', - 'areaServed', - 'availability', - 'availabilityEnds', - 'availabilityStarts', - 'availableAtOrFrom', - 'availableDeliveryMethod', - 'businessFunction', - 'category', - 'deliveryLeadTime', - 'eligibleCustomerType', - 'eligibleDuration', - 'eligibleQuantity', - 'eligibleRegion', - 'eligibleTransactionVolume', - 'gtin', - 'gtin12', - 'gtin13', - 'gtin14', - 'gtin8', - 'includesObject', - 'ineligibleRegion', - 'inventoryLevel', - 'itemCondition', - 'itemOffered', - 'leaseLength', - 'mpn', - 'offeredBy', - 'price', - 'priceCurrency', - 'priceSpecification', - 'priceValidUntil', - 'review', - 'seller', - 'serialNumber', - 'sku', - 'validFrom', - 'validThrough', - 'warranty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptedPaymentMethod' => ['LoanOrCredit', 'PaymentMethod'], - 'addOn' => ['Offer'], - 'advanceBookingRequirement' => ['QuantitativeValue'], - 'aggregateRating' => ['AggregateRating'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'availability' => ['ItemAvailability'], - 'availabilityEnds' => ['Date', 'DateTime', 'Time'], - 'availabilityStarts' => ['Date', 'DateTime', 'Time'], - 'availableAtOrFrom' => ['Place'], - 'availableDeliveryMethod' => ['DeliveryMethod'], - 'businessFunction' => ['BusinessFunction'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'deliveryLeadTime' => ['QuantitativeValue'], - 'eligibleCustomerType' => ['BusinessEntityType'], - 'eligibleDuration' => ['QuantitativeValue'], - 'eligibleQuantity' => ['QuantitativeValue'], - 'eligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'eligibleTransactionVolume' => ['PriceSpecification'], - 'gtin' => ['Text'], - 'gtin12' => ['Text'], - 'gtin13' => ['Text'], - 'gtin14' => ['Text'], - 'gtin8' => ['Text'], - 'includesObject' => ['TypeAndQuantityNode'], - 'ineligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'inventoryLevel' => ['QuantitativeValue'], - 'itemCondition' => ['OfferItemCondition'], - 'itemOffered' => ['AggregateOffer', 'CreativeWork', 'Event', 'MenuItem', 'Product', 'Service', 'Trip'], - 'leaseLength' => ['Duration', 'QuantitativeValue'], - 'mpn' => ['Text'], - 'offeredBy' => ['Organization', 'Person'], - 'price' => ['Number', 'Text'], - 'priceCurrency' => ['Text'], - 'priceSpecification' => ['PriceSpecification'], - 'priceValidUntil' => ['Date'], - 'review' => ['Review'], - 'seller' => ['Organization', 'Person'], - 'serialNumber' => ['Text'], - 'sku' => ['Text'], - 'validFrom' => ['Date', 'DateTime'], - 'validThrough' => ['Date', 'DateTime'], - 'warranty' => ['WarrantyPromise'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptedPaymentMethod' => 'The payment method(s) accepted by seller for this offer.', - 'addOn' => 'An additional offer that can only be obtained in combination with the first base offer (e.g. supplements and extensions that are available for a surcharge).', - 'advanceBookingRequirement' => 'The amount of time that is required between accepting the offer and the actual usage of the resource or service.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'availability' => 'The availability of this item—for example In stock, Out of stock, Pre-order, etc.', - 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', - 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', - 'availableAtOrFrom' => 'The place(s) from which the offer can be obtained (e.g. store locations).', - 'availableDeliveryMethod' => 'The delivery method(s) available for this offer.', - 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'deliveryLeadTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup.', - 'eligibleCustomerType' => 'The type(s) of customers for which the given offer is valid.', - 'eligibleDuration' => 'The duration for which the given offer is valid.', - 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', - 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also ineligibleRegion.', - 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', - 'gtin' => 'A Global Trade Item Number (GTIN). GTINs identify trade items, including products and services, using numeric identification codes. The gtin property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 properties. The GS1 digital link specifications express GTINs as URLs. A correct gtin value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a valid GS1 check digit and meet the other rules for valid GTINs. See also GS1\'s GTIN Summary and Wikipedia for more details. Left-padding of the gtin values is not required or encouraged.', - 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See GS1 GTIN Summary for more details.', - 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceeding zero. See GS1 GTIN Summary for more details.', - 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See GS1 GTIN Summary for more details.', - 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary for more details.', - 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in the offer.', - 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also eligibleRegion.', - 'inventoryLevel' => 'The current approximate inventory level for the item or items.', - 'itemCondition' => 'A predefined value from OfferItemCondition or a textual description of the condition of the product or service, or the products or services included in the offer.', - 'itemOffered' => 'An item being offered (or demanded). The transactional nature of the offer or demand is documented using businessFunction, e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer. Inverse property: offers.', - 'leaseLength' => 'Length of the lease for some Accommodation, either particular to some Offer or in some cases intrinsic to the property.', - 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', - 'offeredBy' => 'A pointer to the organization or person making the offer. Inverse property: makesOffer.', - 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: Use the priceCurrency property (with standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR") instead of including ambiguous symbols such as \'$\' in the value. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', - 'priceValidUntil' => 'The date after which the price is no longer available.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider. Supersedes merchant, vendor.', - 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', - 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', - 'validFrom' => 'The date when the item becomes valid.', - 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', - 'warranty' => 'The warranty promise(s) included in the offer. Supersedes warrantyPromise.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The payment method(s) accepted by seller for this offer. - * - * @var mixed|LoanOrCredit|PaymentMethod [schema.org types: LoanOrCredit, PaymentMethod] - */ - public $acceptedPaymentMethod; - /** - * An additional offer that can only be obtained in combination with the first - * base offer (e.g. supplements and extensions that are available for a - * surcharge). - * - * @var Offer [schema.org types: Offer] - */ - public $addOn; - /** - * The amount of time that is required between accepting the offer and the - * actual usage of the resource or service. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $advanceBookingRequirement; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * The availability of this item—for example In stock, Out of stock, - * Pre-order, etc. - * - * @var ItemAvailability [schema.org types: ItemAvailability] - */ - public $availability; - /** - * The end of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] - */ - public $availabilityEnds; - /** - * The beginning of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] - */ - public $availabilityStarts; - /** - * The place(s) from which the offer can be obtained (e.g. store locations). - * - * @var Place [schema.org types: Place] - */ - public $availableAtOrFrom; - /** - * The delivery method(s) available for this offer. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] - */ - public $availableDeliveryMethod; - /** - * The business function (e.g. sell, lease, repair, dispose) of the offer or - * component of a bundle (TypeAndQuantityNode). The default is - * http://purl.org/goodrelations/v1#Sell. - * - * @var BusinessFunction [schema.org types: BusinessFunction] - */ - public $businessFunction; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * The typical delay between the receipt of the order and the goods either - * leaving the warehouse or being prepared for pickup, in case the delivery - * method is on site pickup. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $deliveryLeadTime; - /** - * The type(s) of customers for which the given offer is valid. - * - * @var BusinessEntityType [schema.org types: BusinessEntityType] - */ - public $eligibleCustomerType; - /** - * The duration for which the given offer is valid. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $eligibleDuration; - /** - * The interval and unit of measurement of ordering quantities for which the - * offer or price specification is valid. This allows e.g. specifying that a - * certain freight charge is valid only for a certain quantity. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $eligibleQuantity; /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is valid. See also ineligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $eligibleRegion; - /** - * The transaction volume, in a monetary unit, for which the offer or price - * specification is valid, e.g. for indicating a minimal purchasing volume, to - * express free shipping above a certain order volume, or to limit the - * acceptance of credit cards to purchases to a certain minimal amount. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $eligibleTransactionVolume; - /** - * A Global Trade Item Number (GTIN). GTINs identify trade items, including - * products and services, using numeric identification codes. The gtin - * property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 - * properties. The GS1 digital link specifications express GTINs as URLs. A - * correct gtin value should be a valid GTIN, which means that it should be an - * all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital - * Link" URL based on such a string. The numeric component should also have a - * valid GS1 check digit and meet the other rules for valid GTINs. See also - * GS1's GTIN Summary and Wikipedia for more details. Left-padding of the gtin - * values is not required or encouraged. - * - * @var string [schema.org types: Text] - */ - public $gtin; - /** - * The GTIN-12 code of the product, or the product to which the offer refers. - * The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. - * Company Prefix, Item Reference, and Check Digit used to identify trade - * items. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin12; - /** - * The GTIN-13 code of the product, or the product to which the offer refers. - * This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit - * UPC codes can be converted into a GTIN-13 code by simply adding a - * preceeding zero. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin13; - /** - * The GTIN-14 code of the product, or the product to which the offer refers. - * See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin14; - /** - * The GTIN-8 code of the product, or the product to which the offer refers. - * This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary - * for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin8; - /** - * This links to a node or nodes indicating the exact quantity of the products - * included in the offer. - * - * @var TypeAndQuantityNode [schema.org types: TypeAndQuantityNode] - */ - public $includesObject; - /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is not valid, e.g. a region where the transaction is - * not allowed. See also eligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $ineligibleRegion; - /** - * The current approximate inventory level for the item or items. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $inventoryLevel; - /** - * A predefined value from OfferItemCondition or a textual description of the - * condition of the product or service, or the products or services included - * in the offer. - * - * @var OfferItemCondition [schema.org types: OfferItemCondition] - */ - public $itemCondition; - /** - * An item being offered (or demanded). The transactional nature of the offer - * or demand is documented using businessFunction, e.g. sell, lease etc. While - * several common expected types are listed explicitly in this definition, - * others can be used. Using a second type, such as Product or a subtype of - * Product, can clarify the nature of the offer. Inverse property: offers. - * - * @var mixed|AggregateOffer|CreativeWork|Event|MenuItem|Product|Service|Trip [schema.org types: AggregateOffer, CreativeWork, Event, MenuItem, Product, Service, Trip] - */ - public $itemOffered; - /** - * Length of the lease for some Accommodation, either particular to some Offer - * or in some cases intrinsic to the property. - * - * @var mixed|Duration|QuantitativeValue [schema.org types: Duration, QuantitativeValue] - */ - public $leaseLength; - /** - * The Manufacturer Part Number (MPN) of the product, or the product to which - * the offer refers. - * - * @var string [schema.org types: Text] - */ - public $mpn; - /** - * A pointer to the organization or person making the offer. Inverse property: - * makesOffer. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $offeredBy; - /** - * The offer price of a product, or of a price component when attached to - * PriceSpecification and its subtypes. Usage guidelines: Use the - * priceCurrency property (with standard formats: ISO 4217 currency format - * e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names - * for Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR") instead of including ambiguous symbols such as '$' in the - * value. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a - * decimal point. Avoid using these symbols as a readability separator. Note - * that both RDFa and Microdata syntax allow the use of a "content=" attribute - * for publishing simple machine-readable values alongside more human-friendly - * formatting. Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to - * 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $price; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; - /** - * One or more detailed price specifications, indicating the unit price and - * delivery or payment charges. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $priceSpecification; - /** - * The date after which the price is no longer available. - * - * @var Date [schema.org types: Date] - */ - public $priceValidUntil; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * An entity which offers (sells / leases / lends / loans) the services / - * goods. A seller may also be a provider. Supersedes merchant, vendor. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $seller; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptedPaymentMethod' => 'The payment method(s) accepted by seller for this offer.', + 'addOn' => 'An additional offer that can only be obtained in combination with the first base offer (e.g. supplements and extensions that are available for a surcharge).', + '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.', + 'advanceBookingRequirement' => 'The amount of time that is required between accepting the offer and the actual usage of the resource or service.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availability' => 'The availability of this item—for example In stock, Out of stock, Pre-order, etc.', + 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', + 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', + 'availableAtOrFrom' => 'The place(s) from which the offer can be obtained (e.g. store locations).', + 'availableDeliveryMethod' => 'The delivery method(s) available for this offer.', + 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'deliveryLeadTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup.', + 'description' => 'A description of the item.', + '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.', + 'eligibleCustomerType' => 'The type(s) of customers for which the given offer is valid.', + 'eligibleDuration' => 'The duration for which the given offer is valid.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also [[ineligibleRegion]]. ', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in an [[Offer]] or [[ProductCollection]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'inventoryLevel' => 'The current approximate inventory level for the item or items.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + 'itemOffered' => 'An item being offered (or demanded). The transactional nature of the offer or demand is documented using [[businessFunction]], e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + '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.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'offeredBy' => 'A pointer to the organization or person making the offer.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + 'priceValidUntil' => 'The date after which the price is no longer available.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider.', + 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', + 'shippingDetails' => 'Indicates information about the shipping policies and options associated with an [[Offer]].', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'warranty' => 'The warranty promise(s) included in the offer.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The serial number or any alphanumeric identifier of a particular product. - * When attached to an offer, it is a shortcut for the serial number of the - * product included in the offer. - * - * @var string [schema.org types: Text] - */ - public $serialNumber; - /** - * The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a - * product or service, or the product to which the offer refers. - * - * @var string [schema.org types: Text] - */ - public $sku; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; - /** - * The date after when the item is not valid. For example the end of an offer, - * salary period, or a period of opening hours. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validThrough; - /** - * The warranty promise(s) included in the offer. Supersedes warrantyPromise. - * - * @var WarrantyPromise [schema.org types: WarrantyPromise] + * @inheritdoc */ - public $warranty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptedPaymentMethod', 'addOn', 'advanceBookingRequirement', 'aggregateRating', 'areaServed', 'availability', 'availabilityEnds', 'availabilityStarts', 'availableAtOrFrom', 'availableDeliveryMethod', 'businessFunction', 'category', 'deliveryLeadTime', 'eligibleCustomerType', 'eligibleDuration', 'eligibleQuantity', 'eligibleRegion', 'eligibleTransactionVolume', 'gtin', 'gtin12', 'gtin13', 'gtin14', 'gtin8', 'includesObject', 'ineligibleRegion', 'inventoryLevel', 'itemCondition', 'itemOffered', 'leaseLength', 'mpn', 'offeredBy', 'price', 'priceCurrency', 'priceSpecification', 'priceValidUntil', 'review', 'seller', 'serialNumber', 'sku', 'validFrom', 'validThrough', 'warranty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfferCatalog.php b/src/models/jsonld/OfferCatalog.php index df6eac249..576ca09ea 100644 --- a/src/models/jsonld/OfferCatalog.php +++ b/src/models/jsonld/OfferCatalog.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itemListElement' => ['Thing', 'ListItem', 'Text'], + 'itemListOrder' => ['Text', 'ItemListOrderType'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'numberOfItems' => ['Integer'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemListElement', - 'itemListOrder', - 'numberOfItems' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemListElement' => ['ListItem', 'Text', 'Thing'], - 'itemListOrder' => ['ItemListOrderType', 'Text'], - 'numberOfItems' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'itemListElement' => 'For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem. Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists. Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a \'position\' property in such cases.', - 'itemListOrder' => 'Type of ordering (e.g. Ascending, Descending, Unordered).', - 'numberOfItems' => 'The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itemListElement' => 'For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem. Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists. Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a \'position\' property in such cases.', + 'itemListOrder' => 'Type of ordering (e.g. Ascending, Descending, Unordered).', + '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.', + 'name' => 'The name of the item.', + 'numberOfItems' => 'The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For itemListElement values, you can use simple strings (e.g. "Peter", - * "Paul", "Mary"), existing entities, or use ListItem. Text values are best - * if the elements in the list are plain strings. Existing entities are best - * for a simple, unordered list of existing things in your data. ListItem is - * used with ordered lists when you want to provide additional context about - * the element in that list or when the same item might be in different places - * in different lists. Note: The order of elements in your mark-up is not - * sufficient for indicating the order or elements. Use ListItem with a - * 'position' property in such cases. - * - * @var mixed|ListItem|string|Thing [schema.org types: ListItem, Text, Thing] - */ - public $itemListElement; - /** - * Type of ordering (e.g. Ascending, Descending, Unordered). - * - * @var mixed|ItemListOrderType|string [schema.org types: ItemListOrderType, Text] - */ - public $itemListOrder; /** - * The number of items in an ItemList. Note that some descriptions might not - * fully describe all items in a list (e.g., multi-page pagination); in such - * cases, the numberOfItems would be for the entire list. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $numberOfItems; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemListElement', 'itemListOrder', 'numberOfItems'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfferCatalogInterface.php b/src/models/jsonld/OfferCatalogInterface.php new file mode 100644 index 000000000..13b82eb4c --- /dev/null +++ b/src/models/jsonld/OfferCatalogInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptedPaymentMethod' => ['LoanOrCredit', 'PaymentMethod'], + 'addOn' => ['Offer'], + 'additionalType' => ['URL'], + 'advanceBookingRequirement' => ['QuantitativeValue'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availability' => ['ItemAvailability'], + 'availabilityEnds' => ['Date', 'DateTime', 'Time'], + 'availabilityStarts' => ['Time', 'DateTime', 'Date'], + 'availableAtOrFrom' => ['Place'], + 'availableDeliveryMethod' => ['DeliveryMethod'], + 'businessFunction' => ['BusinessFunction'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'deliveryLeadTime' => ['QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleCustomerType' => ['BusinessEntityType'], + 'eligibleDuration' => ['QuantitativeValue'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleRegion' => ['GeoShape', 'Text', 'Place'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includesObject' => ['TypeAndQuantityNode'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'inventoryLevel' => ['QuantitativeValue'], + 'isFamilyFriendly' => ['Boolean'], + 'itemCondition' => ['OfferItemCondition'], + 'itemOffered' => ['Trip', 'Event', 'Product', 'AggregateOffer', 'CreativeWork', 'MenuItem', 'Service'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'offeredBy' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'priceValidUntil' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seller' => ['Organization', 'Person'], + 'serialNumber' => ['Text'], + 'shippingDetails' => ['OfferShippingDetails'], + 'sku' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'warranty' => ['WarrantyPromise'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptedPaymentMethod', - 'addOn', - 'advanceBookingRequirement', - 'aggregateRating', - 'areaServed', - 'availability', - 'availabilityEnds', - 'availabilityStarts', - 'availableAtOrFrom', - 'availableDeliveryMethod', - 'businessFunction', - 'category', - 'deliveryLeadTime', - 'eligibleCustomerType', - 'eligibleDuration', - 'eligibleQuantity', - 'eligibleRegion', - 'eligibleTransactionVolume', - 'gtin', - 'gtin12', - 'gtin13', - 'gtin14', - 'gtin8', - 'includesObject', - 'ineligibleRegion', - 'inventoryLevel', - 'itemCondition', - 'itemOffered', - 'leaseLength', - 'mpn', - 'offeredBy', - 'price', - 'priceCurrency', - 'priceSpecification', - 'priceValidUntil', - 'review', - 'seller', - 'serialNumber', - 'sku', - 'validFrom', - 'validThrough', - 'warranty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptedPaymentMethod' => ['LoanOrCredit', 'PaymentMethod'], - 'addOn' => ['Offer'], - 'advanceBookingRequirement' => ['QuantitativeValue'], - 'aggregateRating' => ['AggregateRating'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'availability' => ['ItemAvailability'], - 'availabilityEnds' => ['Date', 'DateTime', 'Time'], - 'availabilityStarts' => ['Date', 'DateTime', 'Time'], - 'availableAtOrFrom' => ['Place'], - 'availableDeliveryMethod' => ['DeliveryMethod'], - 'businessFunction' => ['BusinessFunction'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'deliveryLeadTime' => ['QuantitativeValue'], - 'eligibleCustomerType' => ['BusinessEntityType'], - 'eligibleDuration' => ['QuantitativeValue'], - 'eligibleQuantity' => ['QuantitativeValue'], - 'eligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'eligibleTransactionVolume' => ['PriceSpecification'], - 'gtin' => ['Text'], - 'gtin12' => ['Text'], - 'gtin13' => ['Text'], - 'gtin14' => ['Text'], - 'gtin8' => ['Text'], - 'includesObject' => ['TypeAndQuantityNode'], - 'ineligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'inventoryLevel' => ['QuantitativeValue'], - 'itemCondition' => ['OfferItemCondition'], - 'itemOffered' => ['AggregateOffer', 'CreativeWork', 'Event', 'MenuItem', 'Product', 'Service', 'Trip'], - 'leaseLength' => ['Duration', 'QuantitativeValue'], - 'mpn' => ['Text'], - 'offeredBy' => ['Organization', 'Person'], - 'price' => ['Number', 'Text'], - 'priceCurrency' => ['Text'], - 'priceSpecification' => ['PriceSpecification'], - 'priceValidUntil' => ['Date'], - 'review' => ['Review'], - 'seller' => ['Organization', 'Person'], - 'serialNumber' => ['Text'], - 'sku' => ['Text'], - 'validFrom' => ['Date', 'DateTime'], - 'validThrough' => ['Date', 'DateTime'], - 'warranty' => ['WarrantyPromise'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptedPaymentMethod' => 'The payment method(s) accepted by seller for this offer.', - 'addOn' => 'An additional offer that can only be obtained in combination with the first base offer (e.g. supplements and extensions that are available for a surcharge).', - 'advanceBookingRequirement' => 'The amount of time that is required between accepting the offer and the actual usage of the resource or service.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'availability' => 'The availability of this item—for example In stock, Out of stock, Pre-order, etc.', - 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', - 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', - 'availableAtOrFrom' => 'The place(s) from which the offer can be obtained (e.g. store locations).', - 'availableDeliveryMethod' => 'The delivery method(s) available for this offer.', - 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'deliveryLeadTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup.', - 'eligibleCustomerType' => 'The type(s) of customers for which the given offer is valid.', - 'eligibleDuration' => 'The duration for which the given offer is valid.', - 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', - 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also ineligibleRegion.', - 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', - 'gtin' => 'A Global Trade Item Number (GTIN). GTINs identify trade items, including products and services, using numeric identification codes. The gtin property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 properties. The GS1 digital link specifications express GTINs as URLs. A correct gtin value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a valid GS1 check digit and meet the other rules for valid GTINs. See also GS1\'s GTIN Summary and Wikipedia for more details. Left-padding of the gtin values is not required or encouraged.', - 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See GS1 GTIN Summary for more details.', - 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceeding zero. See GS1 GTIN Summary for more details.', - 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See GS1 GTIN Summary for more details.', - 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary for more details.', - 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in the offer.', - 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also eligibleRegion.', - 'inventoryLevel' => 'The current approximate inventory level for the item or items.', - 'itemCondition' => 'A predefined value from OfferItemCondition or a textual description of the condition of the product or service, or the products or services included in the offer.', - 'itemOffered' => 'An item being offered (or demanded). The transactional nature of the offer or demand is documented using businessFunction, e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer. Inverse property: offers.', - 'leaseLength' => 'Length of the lease for some Accommodation, either particular to some Offer or in some cases intrinsic to the property.', - 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', - 'offeredBy' => 'A pointer to the organization or person making the offer. Inverse property: makesOffer.', - 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: Use the priceCurrency property (with standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR") instead of including ambiguous symbols such as \'$\' in the value. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', - 'priceValidUntil' => 'The date after which the price is no longer available.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider. Supersedes merchant, vendor.', - 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', - 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', - 'validFrom' => 'The date when the item becomes valid.', - 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', - 'warranty' => 'The warranty promise(s) included in the offer. Supersedes warrantyPromise.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The payment method(s) accepted by seller for this offer. - * - * @var mixed|LoanOrCredit|PaymentMethod [schema.org types: LoanOrCredit, PaymentMethod] - */ - public $acceptedPaymentMethod; - /** - * An additional offer that can only be obtained in combination with the first - * base offer (e.g. supplements and extensions that are available for a - * surcharge). - * - * @var Offer [schema.org types: Offer] - */ - public $addOn; - /** - * The amount of time that is required between accepting the offer and the - * actual usage of the resource or service. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $advanceBookingRequirement; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * The availability of this item—for example In stock, Out of stock, - * Pre-order, etc. - * - * @var ItemAvailability [schema.org types: ItemAvailability] - */ - public $availability; - /** - * The end of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] - */ - public $availabilityEnds; - /** - * The beginning of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] - */ - public $availabilityStarts; - /** - * The place(s) from which the offer can be obtained (e.g. store locations). - * - * @var Place [schema.org types: Place] - */ - public $availableAtOrFrom; - /** - * The delivery method(s) available for this offer. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] - */ - public $availableDeliveryMethod; - /** - * The business function (e.g. sell, lease, repair, dispose) of the offer or - * component of a bundle (TypeAndQuantityNode). The default is - * http://purl.org/goodrelations/v1#Sell. - * - * @var BusinessFunction [schema.org types: BusinessFunction] - */ - public $businessFunction; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * The typical delay between the receipt of the order and the goods either - * leaving the warehouse or being prepared for pickup, in case the delivery - * method is on site pickup. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $deliveryLeadTime; - /** - * The type(s) of customers for which the given offer is valid. - * - * @var BusinessEntityType [schema.org types: BusinessEntityType] - */ - public $eligibleCustomerType; - /** - * The duration for which the given offer is valid. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $eligibleDuration; - /** - * The interval and unit of measurement of ordering quantities for which the - * offer or price specification is valid. This allows e.g. specifying that a - * certain freight charge is valid only for a certain quantity. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $eligibleQuantity; /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is valid. See also ineligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $eligibleRegion; - /** - * The transaction volume, in a monetary unit, for which the offer or price - * specification is valid, e.g. for indicating a minimal purchasing volume, to - * express free shipping above a certain order volume, or to limit the - * acceptance of credit cards to purchases to a certain minimal amount. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $eligibleTransactionVolume; - /** - * A Global Trade Item Number (GTIN). GTINs identify trade items, including - * products and services, using numeric identification codes. The gtin - * property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 - * properties. The GS1 digital link specifications express GTINs as URLs. A - * correct gtin value should be a valid GTIN, which means that it should be an - * all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital - * Link" URL based on such a string. The numeric component should also have a - * valid GS1 check digit and meet the other rules for valid GTINs. See also - * GS1's GTIN Summary and Wikipedia for more details. Left-padding of the gtin - * values is not required or encouraged. - * - * @var string [schema.org types: Text] - */ - public $gtin; - /** - * The GTIN-12 code of the product, or the product to which the offer refers. - * The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. - * Company Prefix, Item Reference, and Check Digit used to identify trade - * items. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin12; - /** - * The GTIN-13 code of the product, or the product to which the offer refers. - * This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit - * UPC codes can be converted into a GTIN-13 code by simply adding a - * preceeding zero. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin13; - /** - * The GTIN-14 code of the product, or the product to which the offer refers. - * See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin14; - /** - * The GTIN-8 code of the product, or the product to which the offer refers. - * This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary - * for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin8; - /** - * This links to a node or nodes indicating the exact quantity of the products - * included in the offer. - * - * @var TypeAndQuantityNode [schema.org types: TypeAndQuantityNode] - */ - public $includesObject; - /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is not valid, e.g. a region where the transaction is - * not allowed. See also eligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $ineligibleRegion; - /** - * The current approximate inventory level for the item or items. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $inventoryLevel; - /** - * A predefined value from OfferItemCondition or a textual description of the - * condition of the product or service, or the products or services included - * in the offer. - * - * @var OfferItemCondition [schema.org types: OfferItemCondition] - */ - public $itemCondition; - /** - * An item being offered (or demanded). The transactional nature of the offer - * or demand is documented using businessFunction, e.g. sell, lease etc. While - * several common expected types are listed explicitly in this definition, - * others can be used. Using a second type, such as Product or a subtype of - * Product, can clarify the nature of the offer. Inverse property: offers. - * - * @var mixed|AggregateOffer|CreativeWork|Event|MenuItem|Product|Service|Trip [schema.org types: AggregateOffer, CreativeWork, Event, MenuItem, Product, Service, Trip] - */ - public $itemOffered; - /** - * Length of the lease for some Accommodation, either particular to some Offer - * or in some cases intrinsic to the property. - * - * @var mixed|Duration|QuantitativeValue [schema.org types: Duration, QuantitativeValue] - */ - public $leaseLength; - /** - * The Manufacturer Part Number (MPN) of the product, or the product to which - * the offer refers. - * - * @var string [schema.org types: Text] - */ - public $mpn; - /** - * A pointer to the organization or person making the offer. Inverse property: - * makesOffer. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $offeredBy; - /** - * The offer price of a product, or of a price component when attached to - * PriceSpecification and its subtypes. Usage guidelines: Use the - * priceCurrency property (with standard formats: ISO 4217 currency format - * e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names - * for Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR") instead of including ambiguous symbols such as '$' in the - * value. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a - * decimal point. Avoid using these symbols as a readability separator. Note - * that both RDFa and Microdata syntax allow the use of a "content=" attribute - * for publishing simple machine-readable values alongside more human-friendly - * formatting. Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to - * 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $price; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; - /** - * One or more detailed price specifications, indicating the unit price and - * delivery or payment charges. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $priceSpecification; - /** - * The date after which the price is no longer available. - * - * @var Date [schema.org types: Date] - */ - public $priceValidUntil; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * An entity which offers (sells / leases / lends / loans) the services / - * goods. A seller may also be a provider. Supersedes merchant, vendor. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $seller; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptedPaymentMethod' => 'The payment method(s) accepted by seller for this offer.', + 'addOn' => 'An additional offer that can only be obtained in combination with the first base offer (e.g. supplements and extensions that are available for a surcharge).', + '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.', + 'advanceBookingRequirement' => 'The amount of time that is required between accepting the offer and the actual usage of the resource or service.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availability' => 'The availability of this item—for example In stock, Out of stock, Pre-order, etc.', + 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', + 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', + 'availableAtOrFrom' => 'The place(s) from which the offer can be obtained (e.g. store locations).', + 'availableDeliveryMethod' => 'The delivery method(s) available for this offer.', + 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'deliveryLeadTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup.', + 'description' => 'A description of the item.', + '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.', + 'eligibleCustomerType' => 'The type(s) of customers for which the given offer is valid.', + 'eligibleDuration' => 'The duration for which the given offer is valid.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also [[ineligibleRegion]]. ', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in an [[Offer]] or [[ProductCollection]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'inventoryLevel' => 'The current approximate inventory level for the item or items.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + 'itemOffered' => 'An item being offered (or demanded). The transactional nature of the offer or demand is documented using [[businessFunction]], e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + '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.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'offeredBy' => 'A pointer to the organization or person making the offer.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + 'priceValidUntil' => 'The date after which the price is no longer available.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider.', + 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', + 'shippingDetails' => 'Indicates information about the shipping policies and options associated with an [[Offer]].', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'warranty' => 'The warranty promise(s) included in the offer.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The serial number or any alphanumeric identifier of a particular product. - * When attached to an offer, it is a shortcut for the serial number of the - * product included in the offer. - * - * @var string [schema.org types: Text] - */ - public $serialNumber; - /** - * The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a - * product or service, or the product to which the offer refers. - * - * @var string [schema.org types: Text] - */ - public $sku; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; - /** - * The date after when the item is not valid. For example the end of an offer, - * salary period, or a period of opening hours. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validThrough; - /** - * The warranty promise(s) included in the offer. Supersedes warrantyPromise. - * - * @var WarrantyPromise [schema.org types: WarrantyPromise] + * @inheritdoc */ - public $warranty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptedPaymentMethod', 'addOn', 'advanceBookingRequirement', 'aggregateRating', 'areaServed', 'availability', 'availabilityEnds', 'availabilityStarts', 'availableAtOrFrom', 'availableDeliveryMethod', 'businessFunction', 'category', 'deliveryLeadTime', 'eligibleCustomerType', 'eligibleDuration', 'eligibleQuantity', 'eligibleRegion', 'eligibleTransactionVolume', 'gtin', 'gtin12', 'gtin13', 'gtin14', 'gtin8', 'includesObject', 'ineligibleRegion', 'inventoryLevel', 'itemCondition', 'itemOffered', 'leaseLength', 'mpn', 'offeredBy', 'price', 'priceCurrency', 'priceSpecification', 'priceValidUntil', 'review', 'seller', 'serialNumber', 'sku', 'validFrom', 'validThrough', 'warranty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfferForLeaseInterface.php b/src/models/jsonld/OfferForLeaseInterface.php new file mode 100644 index 000000000..4437c4488 --- /dev/null +++ b/src/models/jsonld/OfferForLeaseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptedPaymentMethod' => ['LoanOrCredit', 'PaymentMethod'], + 'addOn' => ['Offer'], + 'additionalType' => ['URL'], + 'advanceBookingRequirement' => ['QuantitativeValue'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availability' => ['ItemAvailability'], + 'availabilityEnds' => ['Date', 'DateTime', 'Time'], + 'availabilityStarts' => ['Time', 'DateTime', 'Date'], + 'availableAtOrFrom' => ['Place'], + 'availableDeliveryMethod' => ['DeliveryMethod'], + 'businessFunction' => ['BusinessFunction'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'deliveryLeadTime' => ['QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleCustomerType' => ['BusinessEntityType'], + 'eligibleDuration' => ['QuantitativeValue'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleRegion' => ['GeoShape', 'Text', 'Place'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includesObject' => ['TypeAndQuantityNode'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'inventoryLevel' => ['QuantitativeValue'], + 'isFamilyFriendly' => ['Boolean'], + 'itemCondition' => ['OfferItemCondition'], + 'itemOffered' => ['Trip', 'Event', 'Product', 'AggregateOffer', 'CreativeWork', 'MenuItem', 'Service'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'offeredBy' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'priceValidUntil' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seller' => ['Organization', 'Person'], + 'serialNumber' => ['Text'], + 'shippingDetails' => ['OfferShippingDetails'], + 'sku' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'warranty' => ['WarrantyPromise'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptedPaymentMethod', - 'addOn', - 'advanceBookingRequirement', - 'aggregateRating', - 'areaServed', - 'availability', - 'availabilityEnds', - 'availabilityStarts', - 'availableAtOrFrom', - 'availableDeliveryMethod', - 'businessFunction', - 'category', - 'deliveryLeadTime', - 'eligibleCustomerType', - 'eligibleDuration', - 'eligibleQuantity', - 'eligibleRegion', - 'eligibleTransactionVolume', - 'gtin', - 'gtin12', - 'gtin13', - 'gtin14', - 'gtin8', - 'includesObject', - 'ineligibleRegion', - 'inventoryLevel', - 'itemCondition', - 'itemOffered', - 'leaseLength', - 'mpn', - 'offeredBy', - 'price', - 'priceCurrency', - 'priceSpecification', - 'priceValidUntil', - 'review', - 'seller', - 'serialNumber', - 'sku', - 'validFrom', - 'validThrough', - 'warranty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptedPaymentMethod' => ['LoanOrCredit', 'PaymentMethod'], - 'addOn' => ['Offer'], - 'advanceBookingRequirement' => ['QuantitativeValue'], - 'aggregateRating' => ['AggregateRating'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'availability' => ['ItemAvailability'], - 'availabilityEnds' => ['Date', 'DateTime', 'Time'], - 'availabilityStarts' => ['Date', 'DateTime', 'Time'], - 'availableAtOrFrom' => ['Place'], - 'availableDeliveryMethod' => ['DeliveryMethod'], - 'businessFunction' => ['BusinessFunction'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'deliveryLeadTime' => ['QuantitativeValue'], - 'eligibleCustomerType' => ['BusinessEntityType'], - 'eligibleDuration' => ['QuantitativeValue'], - 'eligibleQuantity' => ['QuantitativeValue'], - 'eligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'eligibleTransactionVolume' => ['PriceSpecification'], - 'gtin' => ['Text'], - 'gtin12' => ['Text'], - 'gtin13' => ['Text'], - 'gtin14' => ['Text'], - 'gtin8' => ['Text'], - 'includesObject' => ['TypeAndQuantityNode'], - 'ineligibleRegion' => ['GeoShape', 'Place', 'Text'], - 'inventoryLevel' => ['QuantitativeValue'], - 'itemCondition' => ['OfferItemCondition'], - 'itemOffered' => ['AggregateOffer', 'CreativeWork', 'Event', 'MenuItem', 'Product', 'Service', 'Trip'], - 'leaseLength' => ['Duration', 'QuantitativeValue'], - 'mpn' => ['Text'], - 'offeredBy' => ['Organization', 'Person'], - 'price' => ['Number', 'Text'], - 'priceCurrency' => ['Text'], - 'priceSpecification' => ['PriceSpecification'], - 'priceValidUntil' => ['Date'], - 'review' => ['Review'], - 'seller' => ['Organization', 'Person'], - 'serialNumber' => ['Text'], - 'sku' => ['Text'], - 'validFrom' => ['Date', 'DateTime'], - 'validThrough' => ['Date', 'DateTime'], - 'warranty' => ['WarrantyPromise'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptedPaymentMethod' => 'The payment method(s) accepted by seller for this offer.', - 'addOn' => 'An additional offer that can only be obtained in combination with the first base offer (e.g. supplements and extensions that are available for a surcharge).', - 'advanceBookingRequirement' => 'The amount of time that is required between accepting the offer and the actual usage of the resource or service.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'availability' => 'The availability of this item—for example In stock, Out of stock, Pre-order, etc.', - 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', - 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', - 'availableAtOrFrom' => 'The place(s) from which the offer can be obtained (e.g. store locations).', - 'availableDeliveryMethod' => 'The delivery method(s) available for this offer.', - 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'deliveryLeadTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup.', - 'eligibleCustomerType' => 'The type(s) of customers for which the given offer is valid.', - 'eligibleDuration' => 'The duration for which the given offer is valid.', - 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', - 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also ineligibleRegion.', - 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', - 'gtin' => 'A Global Trade Item Number (GTIN). GTINs identify trade items, including products and services, using numeric identification codes. The gtin property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 properties. The GS1 digital link specifications express GTINs as URLs. A correct gtin value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a valid GS1 check digit and meet the other rules for valid GTINs. See also GS1\'s GTIN Summary and Wikipedia for more details. Left-padding of the gtin values is not required or encouraged.', - 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See GS1 GTIN Summary for more details.', - 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceeding zero. See GS1 GTIN Summary for more details.', - 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See GS1 GTIN Summary for more details.', - 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary for more details.', - 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in the offer.', - 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also eligibleRegion.', - 'inventoryLevel' => 'The current approximate inventory level for the item or items.', - 'itemCondition' => 'A predefined value from OfferItemCondition or a textual description of the condition of the product or service, or the products or services included in the offer.', - 'itemOffered' => 'An item being offered (or demanded). The transactional nature of the offer or demand is documented using businessFunction, e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer. Inverse property: offers.', - 'leaseLength' => 'Length of the lease for some Accommodation, either particular to some Offer or in some cases intrinsic to the property.', - 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', - 'offeredBy' => 'A pointer to the organization or person making the offer. Inverse property: makesOffer.', - 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: Use the priceCurrency property (with standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR") instead of including ambiguous symbols such as \'$\' in the value. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', - 'priceValidUntil' => 'The date after which the price is no longer available.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider. Supersedes merchant, vendor.', - 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', - 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', - 'validFrom' => 'The date when the item becomes valid.', - 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', - 'warranty' => 'The warranty promise(s) included in the offer. Supersedes warrantyPromise.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The payment method(s) accepted by seller for this offer. - * - * @var mixed|LoanOrCredit|PaymentMethod [schema.org types: LoanOrCredit, PaymentMethod] - */ - public $acceptedPaymentMethod; - /** - * An additional offer that can only be obtained in combination with the first - * base offer (e.g. supplements and extensions that are available for a - * surcharge). - * - * @var Offer [schema.org types: Offer] - */ - public $addOn; - /** - * The amount of time that is required between accepting the offer and the - * actual usage of the resource or service. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $advanceBookingRequirement; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * The availability of this item—for example In stock, Out of stock, - * Pre-order, etc. - * - * @var ItemAvailability [schema.org types: ItemAvailability] - */ - public $availability; - /** - * The end of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] - */ - public $availabilityEnds; - /** - * The beginning of the availability of the product or service included in the - * offer. - * - * @var mixed|Date|DateTime|Time [schema.org types: Date, DateTime, Time] - */ - public $availabilityStarts; - /** - * The place(s) from which the offer can be obtained (e.g. store locations). - * - * @var Place [schema.org types: Place] - */ - public $availableAtOrFrom; - /** - * The delivery method(s) available for this offer. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] - */ - public $availableDeliveryMethod; - /** - * The business function (e.g. sell, lease, repair, dispose) of the offer or - * component of a bundle (TypeAndQuantityNode). The default is - * http://purl.org/goodrelations/v1#Sell. - * - * @var BusinessFunction [schema.org types: BusinessFunction] - */ - public $businessFunction; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * The typical delay between the receipt of the order and the goods either - * leaving the warehouse or being prepared for pickup, in case the delivery - * method is on site pickup. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $deliveryLeadTime; - /** - * The type(s) of customers for which the given offer is valid. - * - * @var BusinessEntityType [schema.org types: BusinessEntityType] - */ - public $eligibleCustomerType; - /** - * The duration for which the given offer is valid. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $eligibleDuration; - /** - * The interval and unit of measurement of ordering quantities for which the - * offer or price specification is valid. This allows e.g. specifying that a - * certain freight charge is valid only for a certain quantity. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $eligibleQuantity; /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is valid. See also ineligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $eligibleRegion; - /** - * The transaction volume, in a monetary unit, for which the offer or price - * specification is valid, e.g. for indicating a minimal purchasing volume, to - * express free shipping above a certain order volume, or to limit the - * acceptance of credit cards to purchases to a certain minimal amount. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $eligibleTransactionVolume; - /** - * A Global Trade Item Number (GTIN). GTINs identify trade items, including - * products and services, using numeric identification codes. The gtin - * property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 - * properties. The GS1 digital link specifications express GTINs as URLs. A - * correct gtin value should be a valid GTIN, which means that it should be an - * all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital - * Link" URL based on such a string. The numeric component should also have a - * valid GS1 check digit and meet the other rules for valid GTINs. See also - * GS1's GTIN Summary and Wikipedia for more details. Left-padding of the gtin - * values is not required or encouraged. - * - * @var string [schema.org types: Text] - */ - public $gtin; - /** - * The GTIN-12 code of the product, or the product to which the offer refers. - * The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. - * Company Prefix, Item Reference, and Check Digit used to identify trade - * items. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin12; - /** - * The GTIN-13 code of the product, or the product to which the offer refers. - * This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit - * UPC codes can be converted into a GTIN-13 code by simply adding a - * preceeding zero. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin13; - /** - * The GTIN-14 code of the product, or the product to which the offer refers. - * See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin14; - /** - * The GTIN-8 code of the product, or the product to which the offer refers. - * This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary - * for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin8; - /** - * This links to a node or nodes indicating the exact quantity of the products - * included in the offer. - * - * @var TypeAndQuantityNode [schema.org types: TypeAndQuantityNode] - */ - public $includesObject; - /** - * The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the - * GeoShape for the geo-political region(s) for which the offer or delivery - * charge specification is not valid, e.g. a region where the transaction is - * not allowed. See also eligibleRegion. - * - * @var mixed|GeoShape|Place|string [schema.org types: GeoShape, Place, Text] - */ - public $ineligibleRegion; - /** - * The current approximate inventory level for the item or items. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $inventoryLevel; - /** - * A predefined value from OfferItemCondition or a textual description of the - * condition of the product or service, or the products or services included - * in the offer. - * - * @var OfferItemCondition [schema.org types: OfferItemCondition] - */ - public $itemCondition; - /** - * An item being offered (or demanded). The transactional nature of the offer - * or demand is documented using businessFunction, e.g. sell, lease etc. While - * several common expected types are listed explicitly in this definition, - * others can be used. Using a second type, such as Product or a subtype of - * Product, can clarify the nature of the offer. Inverse property: offers. - * - * @var mixed|AggregateOffer|CreativeWork|Event|MenuItem|Product|Service|Trip [schema.org types: AggregateOffer, CreativeWork, Event, MenuItem, Product, Service, Trip] - */ - public $itemOffered; - /** - * Length of the lease for some Accommodation, either particular to some Offer - * or in some cases intrinsic to the property. - * - * @var mixed|Duration|QuantitativeValue [schema.org types: Duration, QuantitativeValue] - */ - public $leaseLength; - /** - * The Manufacturer Part Number (MPN) of the product, or the product to which - * the offer refers. - * - * @var string [schema.org types: Text] - */ - public $mpn; - /** - * A pointer to the organization or person making the offer. Inverse property: - * makesOffer. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $offeredBy; - /** - * The offer price of a product, or of a price component when attached to - * PriceSpecification and its subtypes. Usage guidelines: Use the - * priceCurrency property (with standard formats: ISO 4217 currency format - * e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names - * for Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR") instead of including ambiguous symbols such as '$' in the - * value. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a - * decimal point. Avoid using these symbols as a readability separator. Note - * that both RDFa and Microdata syntax allow the use of a "content=" attribute - * for publishing simple machine-readable values alongside more human-friendly - * formatting. Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to - * 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $price; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; - /** - * One or more detailed price specifications, indicating the unit price and - * delivery or payment charges. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $priceSpecification; - /** - * The date after which the price is no longer available. - * - * @var Date [schema.org types: Date] - */ - public $priceValidUntil; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * An entity which offers (sells / leases / lends / loans) the services / - * goods. A seller may also be a provider. Supersedes merchant, vendor. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $seller; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptedPaymentMethod' => 'The payment method(s) accepted by seller for this offer.', + 'addOn' => 'An additional offer that can only be obtained in combination with the first base offer (e.g. supplements and extensions that are available for a surcharge).', + '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.', + 'advanceBookingRequirement' => 'The amount of time that is required between accepting the offer and the actual usage of the resource or service.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availability' => 'The availability of this item—for example In stock, Out of stock, Pre-order, etc.', + 'availabilityEnds' => 'The end of the availability of the product or service included in the offer.', + 'availabilityStarts' => 'The beginning of the availability of the product or service included in the offer.', + 'availableAtOrFrom' => 'The place(s) from which the offer can be obtained (e.g. store locations).', + 'availableDeliveryMethod' => 'The delivery method(s) available for this offer.', + 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'deliveryLeadTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup.', + 'description' => 'A description of the item.', + '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.', + 'eligibleCustomerType' => 'The type(s) of customers for which the given offer is valid.', + 'eligibleDuration' => 'The duration for which the given offer is valid.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid. See also [[ineligibleRegion]]. ', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in an [[Offer]] or [[ProductCollection]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'inventoryLevel' => 'The current approximate inventory level for the item or items.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + 'itemOffered' => 'An item being offered (or demanded). The transactional nature of the offer or demand is documented using [[businessFunction]], e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + '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.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'offeredBy' => 'A pointer to the organization or person making the offer.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + 'priceValidUntil' => 'The date after which the price is no longer available.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider.', + 'serialNumber' => 'The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer.', + 'shippingDetails' => 'Indicates information about the shipping policies and options associated with an [[Offer]].', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'warranty' => 'The warranty promise(s) included in the offer.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The serial number or any alphanumeric identifier of a particular product. - * When attached to an offer, it is a shortcut for the serial number of the - * product included in the offer. - * - * @var string [schema.org types: Text] - */ - public $serialNumber; - /** - * The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a - * product or service, or the product to which the offer refers. - * - * @var string [schema.org types: Text] - */ - public $sku; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; - /** - * The date after when the item is not valid. For example the end of an offer, - * salary period, or a period of opening hours. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validThrough; - /** - * The warranty promise(s) included in the offer. Supersedes warrantyPromise. - * - * @var WarrantyPromise [schema.org types: WarrantyPromise] + * @inheritdoc */ - public $warranty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptedPaymentMethod', 'addOn', 'advanceBookingRequirement', 'aggregateRating', 'areaServed', 'availability', 'availabilityEnds', 'availabilityStarts', 'availableAtOrFrom', 'availableDeliveryMethod', 'businessFunction', 'category', 'deliveryLeadTime', 'eligibleCustomerType', 'eligibleDuration', 'eligibleQuantity', 'eligibleRegion', 'eligibleTransactionVolume', 'gtin', 'gtin12', 'gtin13', 'gtin14', 'gtin8', 'includesObject', 'ineligibleRegion', 'inventoryLevel', 'itemCondition', 'itemOffered', 'leaseLength', 'mpn', 'offeredBy', 'price', 'priceCurrency', 'priceSpecification', 'priceValidUntil', 'review', 'seller', 'serialNumber', 'sku', 'validFrom', 'validThrough', 'warranty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfferForPurchaseInterface.php b/src/models/jsonld/OfferForPurchaseInterface.php new file mode 100644 index 000000000..95a45b3aa --- /dev/null +++ b/src/models/jsonld/OfferForPurchaseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfferItemConditionInterface.php b/src/models/jsonld/OfferItemConditionInterface.php new file mode 100644 index 000000000..72222ce34 --- /dev/null +++ b/src/models/jsonld/OfferItemConditionInterface.php @@ -0,0 +1,24 @@ + ['AdministrativeArea'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'shippingDestination' => 'shippingDestination indicates the target region for an online shipping destination.' - ]; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } + /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'deliveryTime' => ['ShippingDeliveryTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doesNotShip' => ['Boolean'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'shippingDestination' => ['DefinedRegion'], + 'shippingLabel' => ['Text'], + 'shippingRate' => ['MonetaryAmount'], + 'shippingSettingsLink' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'transitTimeLabel' => ['Text'], + 'url' => ['URL'] + ]; + } + /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'deliveryTime' => 'The total delay between the receipt of the order and the goods reaching the final customer.', + 'description' => 'A description of the item.', + '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.', + 'doesNotShip' => 'Indicates when shipping to a particular [[shippingDestination]] is not available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'shippingDestination' => 'indicates (possibly multiple) shipping destinations. These can be defined in several ways e.g. postalCode ranges.', + 'shippingLabel' => 'Label to match an [[OfferShippingDetails]] with a [[ShippingRateSettings]] (within the context of a [[shippingSettingsLink]] cross-reference).', + 'shippingRate' => 'The shipping rate is the cost of shipping to the specified destination. Typically, the maxValue and currency values (of the [[MonetaryAmount]]) are most appropriate.', + 'shippingSettingsLink' => 'Link to a page containing [[ShippingRateSettings]] and [[DeliveryTimeSettings]] details.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'transitTimeLabel' => 'Label to match an [[OfferShippingDetails]] with a [[DeliveryTimeSettings]] (within the context of a [[shippingSettingsLink]] cross-reference).', + 'url' => 'URL of the item.' + ]; + } + /** - * shippingDestination indicates the target region for an online shipping - * destination. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] + * @inheritdoc */ - public $shippingDestination; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['shippingDestination'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfferShippingDetailsInterface.php b/src/models/jsonld/OfferShippingDetailsInterface.php new file mode 100644 index 000000000..1ec4cc8b4 --- /dev/null +++ b/src/models/jsonld/OfferShippingDetailsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfficeEquipmentStoreInterface.php b/src/models/jsonld/OfficeEquipmentStoreInterface.php new file mode 100644 index 000000000..5c6627fce --- /dev/null +++ b/src/models/jsonld/OfficeEquipmentStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfficialLegalValueInterface.php b/src/models/jsonld/OfficialLegalValueInterface.php new file mode 100644 index 000000000..f32982202 --- /dev/null +++ b/src/models/jsonld/OfficialLegalValueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfflineEventAttendanceModeInterface.php b/src/models/jsonld/OfflineEventAttendanceModeInterface.php new file mode 100644 index 000000000..79d6f9e5b --- /dev/null +++ b/src/models/jsonld/OfflineEventAttendanceModeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfflinePermanentlyInterface.php b/src/models/jsonld/OfflinePermanentlyInterface.php new file mode 100644 index 000000000..b4953cfbc --- /dev/null +++ b/src/models/jsonld/OfflinePermanentlyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OfflineTemporarilyInterface.php b/src/models/jsonld/OfflineTemporarilyInterface.php new file mode 100644 index 000000000..479803025 --- /dev/null +++ b/src/models/jsonld/OfflineTemporarilyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'free' => ['Boolean'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'publishedBy' => ['Organization', 'Person'], + 'publishedOn' => ['BroadcastService'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'isAccessibleForFree', - 'publishedBy', - 'publishedOn' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'isAccessibleForFree' => ['Boolean'], - 'publishedBy' => ['Organization', 'Person'], - 'publishedOn' => ['BroadcastService'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'publishedBy' => 'An agent associated with the publication event.', - 'publishedOn' => 'A broadcast service associated with the publication event.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'free' => 'A flag to signal that the item, event, or place is accessible for free.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'publishedBy' => 'An agent associated with the publication event.', + 'publishedOn' => 'A broadcast service associated with the publication event.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * An agent associated with the publication event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publishedBy; /** - * A broadcast service associated with the publication event. - * - * @var BroadcastService [schema.org types: BroadcastService] + * @inheritdoc */ - public $publishedOn; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['isAccessibleForFree', 'publishedBy', 'publishedOn'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OnDemandEventInterface.php b/src/models/jsonld/OnDemandEventInterface.php new file mode 100644 index 000000000..bd4f02f94 --- /dev/null +++ b/src/models/jsonld/OnDemandEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OnSitePickupInterface.php b/src/models/jsonld/OnSitePickupInterface.php new file mode 100644 index 000000000..c75efef15 --- /dev/null +++ b/src/models/jsonld/OnSitePickupInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OncologicInterface.php b/src/models/jsonld/OncologicInterface.php new file mode 100644 index 000000000..90cb2f0a6 --- /dev/null +++ b/src/models/jsonld/OncologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/OneTimePaymentsInterface.php b/src/models/jsonld/OneTimePaymentsInterface.php new file mode 100644 index 000000000..36910290e --- /dev/null +++ b/src/models/jsonld/OneTimePaymentsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OnlineBusiness.php b/src/models/jsonld/OnlineBusiness.php new file mode 100644 index 000000000..5d11ae601 --- /dev/null +++ b/src/models/jsonld/OnlineBusiness.php @@ -0,0 +1,281 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/OnlineBusinessInterface.php b/src/models/jsonld/OnlineBusinessInterface.php new file mode 100644 index 000000000..15e8fb3bf --- /dev/null +++ b/src/models/jsonld/OnlineBusinessInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OnlineEventAttendanceModeInterface.php b/src/models/jsonld/OnlineEventAttendanceModeInterface.php new file mode 100644 index 000000000..4756a01d4 --- /dev/null +++ b/src/models/jsonld/OnlineEventAttendanceModeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OnlineFullInterface.php b/src/models/jsonld/OnlineFullInterface.php new file mode 100644 index 000000000..ebf7472af --- /dev/null +++ b/src/models/jsonld/OnlineFullInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OnlineOnlyInterface.php b/src/models/jsonld/OnlineOnlyInterface.php new file mode 100644 index 000000000..71bb1f78c --- /dev/null +++ b/src/models/jsonld/OnlineOnlyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/OnlineStoreInterface.php b/src/models/jsonld/OnlineStoreInterface.php new file mode 100644 index 000000000..18b201492 --- /dev/null +++ b/src/models/jsonld/OnlineStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OpenTrialInterface.php b/src/models/jsonld/OpenTrialInterface.php new file mode 100644 index 000000000..1ac2bd8c8 --- /dev/null +++ b/src/models/jsonld/OpenTrialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'closes' => ['Time'], + 'dayOfWeek' => ['DayOfWeek'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'opens' => ['Time'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'closes', - 'dayOfWeek', - 'opens', - 'validFrom', - 'validThrough' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'closes' => ['Time'], - 'dayOfWeek' => ['DayOfWeek'], - 'opens' => ['Time'], - 'validFrom' => ['Date', 'DateTime'], - 'validThrough' => ['Date', 'DateTime'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'closes' => 'The closing hour of the place or service on the given day(s) of the week.', - 'dayOfWeek' => 'The day of the week for which these opening hours are valid.', - 'opens' => 'The opening hour of the place or service on the given day(s) of the week.', - 'validFrom' => 'The date when the item becomes valid.', - 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'closes' => 'The closing hour of the place or service on the given day(s) of the week.', + 'dayOfWeek' => 'The day of the week for which these opening hours are valid.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'opens' => 'The opening hour of the place or service on the given day(s) of the week.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The closing hour of the place or service on the given day(s) of the week. - * - * @var Time [schema.org types: Time] - */ - public $closes; - /** - * The day of the week for which these opening hours are valid. - * - * @var DayOfWeek [schema.org types: DayOfWeek] - */ - public $dayOfWeek; - /** - * The opening hour of the place or service on the given day(s) of the week. - * - * @var Time [schema.org types: Time] - */ - public $opens; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; - /** - * The date after when the item is not valid. For example the end of an offer, - * salary period, or a period of opening hours. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $validThrough; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['closes', 'dayOfWeek', 'opens', 'validFrom', 'validThrough'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OpeningHoursSpecificationInterface.php b/src/models/jsonld/OpeningHoursSpecificationInterface.php new file mode 100644 index 000000000..bce3fb88c --- /dev/null +++ b/src/models/jsonld/OpeningHoursSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dateline' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'printColumn' => ['Text'], + 'printEdition' => ['Text'], + 'printPage' => ['Text'], + 'printSection' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dateline', - 'printColumn', - 'printEdition', - 'printPage', - 'printSection' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dateline' => ['Text'], - 'printColumn' => ['Text'], - 'printEdition' => ['Text'], - 'printPage' => ['Text'], - 'printSection' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dateline' => 'A dateline is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using locationCreated (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use contentLocation. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines".', - 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', - 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', - 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', - 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dateline' => 'A [dateline](https://en.wikipedia.org/wiki/Dateline) is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using [[locationCreated]] (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use [[contentLocation]]. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines". ', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', + 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', + 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', + 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A dateline is a brief piece of text included in news articles that - * describes where and when the story was written or filed though the date is - * often omitted. Sometimes only a placename is provided. Structured - * representations of dateline-related information can also be expressed more - * explicitly using locationCreated (which represents where a work was created - * e.g. where a news report was written). For location depicted or described - * in the content, use contentLocation. Dateline summaries are oriented more - * towards human readers than towards automated processing, and can vary - * substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", - * "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", - * "QUEZON CITY, Philippines". - * - * @var string [schema.org types: Text] - */ - public $dateline; - /** - * The number of the column in which the NewsArticle appears in the print - * edition. - * - * @var string [schema.org types: Text] - */ - public $printColumn; - /** - * The edition of the print product in which the NewsArticle appears. - * - * @var string [schema.org types: Text] - */ - public $printEdition; - /** - * If this NewsArticle appears in print, this field indicates the name of the - * page on which the article is found. Please note that this field is intended - * for the exact page name (e.g. A5, B18). - * - * @var string [schema.org types: Text] - */ - public $printPage; - /** - * If this NewsArticle appears in print, this field indicates the print - * section in which the article appeared. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $printSection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dateline', 'printColumn', 'printEdition', 'printPage', 'printSection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OpinionNewsArticleInterface.php b/src/models/jsonld/OpinionNewsArticleInterface.php new file mode 100644 index 000000000..23df2296d --- /dev/null +++ b/src/models/jsonld/OpinionNewsArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OpticianInterface.php b/src/models/jsonld/OpticianInterface.php new file mode 100644 index 000000000..8131eafe5 --- /dev/null +++ b/src/models/jsonld/OpticianInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OptometricInterface.php b/src/models/jsonld/OptometricInterface.php new file mode 100644 index 000000000..2085fb1f5 --- /dev/null +++ b/src/models/jsonld/OptometricInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptedOffer' => ['Offer'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'billingAddress' => ['PostalAddress'], + 'broker' => ['Person', 'Organization'], + 'confirmationNumber' => ['Text'], + 'customer' => ['Organization', 'Person'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discount' => ['Text', 'Number'], + 'discountCode' => ['Text'], + 'discountCurrency' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isGift' => ['Boolean'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'merchant' => ['Organization', 'Person'], + 'name' => ['Text'], + 'orderDate' => ['Date', 'DateTime'], + 'orderDelivery' => ['ParcelDelivery'], + 'orderNumber' => ['Text'], + 'orderStatus' => ['OrderStatus'], + 'orderedItem' => ['Service', 'OrderItem', 'Product'], + 'partOfInvoice' => ['Invoice'], + 'paymentDue' => ['DateTime'], + 'paymentDueDate' => ['DateTime', 'Date'], + 'paymentMethod' => ['PaymentMethod'], + 'paymentMethodId' => ['Text'], + 'paymentUrl' => ['URL'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'seller' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptedOffer', - 'billingAddress', - 'broker', - 'confirmationNumber', - 'customer', - 'discount', - 'discountCode', - 'discountCurrency', - 'isGift', - 'orderDate', - 'orderDelivery', - 'orderNumber', - 'orderStatus', - 'orderedItem', - 'partOfInvoice', - 'paymentDueDate', - 'paymentMethod', - 'paymentMethodId', - 'paymentUrl', - 'seller' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptedOffer' => ['Offer'], - 'billingAddress' => ['PostalAddress'], - 'broker' => ['Organization', 'Person'], - 'confirmationNumber' => ['Text'], - 'customer' => ['Organization', 'Person'], - 'discount' => ['Number', 'Text'], - 'discountCode' => ['Text'], - 'discountCurrency' => ['Text'], - 'isGift' => ['Boolean'], - 'orderDate' => ['Date', 'DateTime'], - 'orderDelivery' => ['ParcelDelivery'], - 'orderNumber' => ['Text'], - 'orderStatus' => ['OrderStatus'], - 'orderedItem' => ['OrderItem', 'Product', 'Service'], - 'partOfInvoice' => ['Invoice'], - 'paymentDueDate' => ['Date', 'DateTime'], - 'paymentMethod' => ['PaymentMethod'], - 'paymentMethodId' => ['Text'], - 'paymentUrl' => ['URL'], - 'seller' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptedOffer' => 'The offer(s) -- e.g., product, quantity and price combinations -- included in the order.', - 'billingAddress' => 'The billing address for the order.', - '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. Supersedes bookingAgent.', - 'confirmationNumber' => 'A number that confirms the given order or payment has been received.', - 'customer' => 'Party placing the order or paying the invoice.', - 'discount' => 'Any discount applied (to an Order).', - 'discountCode' => 'Code used to redeem a discount.', - 'discountCurrency' => 'The currency of the discount. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'isGift' => 'Was the offer accepted as a gift for someone other than the buyer.', - 'orderDate' => 'Date order was placed.', - 'orderDelivery' => 'The delivery of the parcel related to this order or order item.', - 'orderNumber' => 'The identifier of the transaction.', - 'orderStatus' => 'The current status of the order.', - 'orderedItem' => 'The item ordered.', - 'partOfInvoice' => 'The order is being paid as part of the referenced Invoice.', - 'paymentDueDate' => 'The date that payment is due. Supersedes paymentDue.', - 'paymentMethod' => 'The name of the credit card or other method of payment for the order.', - 'paymentMethodId' => 'An identifier for the method of payment used (e.g. the last 4 digits of the credit card).', - 'paymentUrl' => 'The URL for sending a payment.', - 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider. Supersedes merchant, vendor.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The offer(s) -- e.g., product, quantity and price combinations -- included - * in the order. - * - * @var Offer [schema.org types: Offer] - */ - public $acceptedOffer; - /** - * The billing address for the order. - * - * @var PostalAddress [schema.org types: PostalAddress] - */ - public $billingAddress; - /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * A number that confirms the given order or payment has been received. - * - * @var string [schema.org types: Text] - */ - public $confirmationNumber; - /** - * Party placing the order or paying the invoice. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $customer; /** - * Any discount applied (to an Order). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $discount; - /** - * Code used to redeem a discount. - * - * @var string [schema.org types: Text] - */ - public $discountCode; - /** - * The currency of the discount. Use standard formats: ISO 4217 currency - * format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well - * known names for Local Exchange Tradings Systems (LETS) and other currency - * types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $discountCurrency; - /** - * Was the offer accepted as a gift for someone other than the buyer. - * - * @var bool [schema.org types: Boolean] - */ - public $isGift; - /** - * Date order was placed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $orderDate; - /** - * The delivery of the parcel related to this order or order item. - * - * @var ParcelDelivery [schema.org types: ParcelDelivery] - */ - public $orderDelivery; - /** - * The identifier of the transaction. - * - * @var string [schema.org types: Text] - */ - public $orderNumber; - /** - * The current status of the order. - * - * @var OrderStatus [schema.org types: OrderStatus] - */ - public $orderStatus; - /** - * The item ordered. - * - * @var mixed|OrderItem|Product|Service [schema.org types: OrderItem, Product, Service] - */ - public $orderedItem; - /** - * The order is being paid as part of the referenced Invoice. - * - * @var Invoice [schema.org types: Invoice] + * @inheritdoc */ - public $partOfInvoice; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptedOffer' => 'The offer(s) -- e.g., product, quantity and price combinations -- included in the order.', + '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.', + 'alternateName' => 'An alias for the item.', + 'billingAddress' => 'The billing address for the order.', + '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.', + 'confirmationNumber' => 'A number that confirms the given order or payment has been received.', + 'customer' => 'Party placing the order or paying the invoice.', + 'description' => 'A description of the item.', + '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.', + 'discount' => 'Any discount applied (to an Order).', + 'discountCode' => 'Code used to redeem a discount.', + 'discountCurrency' => 'The currency of the discount. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isGift' => 'Was the offer accepted as a gift for someone other than the buyer.', + '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.', + 'merchant' => '\'merchant\' is an out-dated term for \'seller\'.', + 'name' => 'The name of the item.', + 'orderDate' => 'Date order was placed.', + 'orderDelivery' => 'The delivery of the parcel related to this order or order item.', + 'orderNumber' => 'The identifier of the transaction.', + 'orderStatus' => 'The current status of the order.', + 'orderedItem' => 'The item ordered.', + 'partOfInvoice' => 'The order is being paid as part of the referenced Invoice.', + 'paymentDue' => 'The date that payment is due.', + 'paymentDueDate' => 'The date that payment is due.', + 'paymentMethod' => 'The name of the credit card or other method of payment for the order.', + 'paymentMethodId' => 'An identifier for the method of payment used (e.g. the last 4 digits of the credit card).', + 'paymentUrl' => 'The URL for sending a payment.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'seller' => 'An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The date that payment is due. Supersedes paymentDue. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $paymentDueDate; - /** - * The name of the credit card or other method of payment for the order. - * - * @var PaymentMethod [schema.org types: PaymentMethod] - */ - public $paymentMethod; - /** - * An identifier for the method of payment used (e.g. the last 4 digits of the - * credit card). - * - * @var string [schema.org types: Text] - */ - public $paymentMethodId; /** - * The URL for sending a payment. - * - * @var string [schema.org types: URL] - */ - public $paymentUrl; - /** - * An entity which offers (sells / leases / lends / loans) the services / - * goods. A seller may also be a provider. Supersedes merchant, vendor. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $seller; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptedOffer', 'billingAddress', 'broker', 'confirmationNumber', 'customer', 'discount', 'discountCode', 'discountCurrency', 'isGift', 'orderDate', 'orderDelivery', 'orderNumber', 'orderStatus', 'orderedItem', 'partOfInvoice', 'paymentDueDate', 'paymentMethod', 'paymentMethodId', 'paymentUrl', 'seller'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderAction.php b/src/models/jsonld/OrderAction.php index 4a7caa1c8..eb9ca6082 100644 --- a/src/models/jsonld/OrderAction.php +++ b/src/models/jsonld/OrderAction.php @@ -1,28 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'deliveryMethod' => ['DeliveryMethod'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'deliveryMethod' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'deliveryMethod' => 'A sub property of instrument. The method of delivery.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'deliveryMethod' => ['DeliveryMethod'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'deliveryMethod' => 'A sub property of instrument. The method of delivery.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of instrument. The method of delivery. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] + * @inheritdoc */ - public $deliveryMethod; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['deliveryMethod'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderActionInterface.php b/src/models/jsonld/OrderActionInterface.php new file mode 100644 index 000000000..2e0d3b57e --- /dev/null +++ b/src/models/jsonld/OrderActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderCancelledInterface.php b/src/models/jsonld/OrderCancelledInterface.php new file mode 100644 index 000000000..23246b5fb --- /dev/null +++ b/src/models/jsonld/OrderCancelledInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderDeliveredInterface.php b/src/models/jsonld/OrderDeliveredInterface.php new file mode 100644 index 000000000..9c1551b9e --- /dev/null +++ b/src/models/jsonld/OrderDeliveredInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderInTransitInterface.php b/src/models/jsonld/OrderInTransitInterface.php new file mode 100644 index 000000000..28e2d4aed --- /dev/null +++ b/src/models/jsonld/OrderInTransitInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'orderDelivery' => ['ParcelDelivery'], + 'orderItemNumber' => ['Text'], + 'orderItemStatus' => ['OrderStatus'], + 'orderQuantity' => ['Number'], + 'orderedItem' => ['Service', 'OrderItem', 'Product'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'orderDelivery', - 'orderItemNumber', - 'orderItemStatus', - 'orderQuantity', - 'orderedItem' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'orderDelivery' => ['ParcelDelivery'], - 'orderItemNumber' => ['Text'], - 'orderItemStatus' => ['OrderStatus'], - 'orderQuantity' => ['Number'], - 'orderedItem' => ['OrderItem', 'Product', 'Service'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'orderDelivery' => 'The delivery of the parcel related to this order or order item.', - 'orderItemNumber' => 'The identifier of the order item.', - 'orderItemStatus' => 'The current status of the order item.', - 'orderQuantity' => 'The number of the item ordered. If the property is not set, assume the quantity is one.', - 'orderedItem' => 'The item ordered.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'orderDelivery' => 'The delivery of the parcel related to this order or order item.', + 'orderItemNumber' => 'The identifier of the order item.', + 'orderItemStatus' => 'The current status of the order item.', + 'orderQuantity' => 'The number of the item ordered. If the property is not set, assume the quantity is one.', + 'orderedItem' => 'The item ordered.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The delivery of the parcel related to this order or order item. - * - * @var ParcelDelivery [schema.org types: ParcelDelivery] - */ - public $orderDelivery; - /** - * The identifier of the order item. - * - * @var string [schema.org types: Text] - */ - public $orderItemNumber; - /** - * The current status of the order item. - * - * @var OrderStatus [schema.org types: OrderStatus] - */ - public $orderItemStatus; - /** - * The number of the item ordered. If the property is not set, assume the - * quantity is one. - * - * @var float [schema.org types: Number] - */ - public $orderQuantity; - /** - * The item ordered. - * - * @var mixed|OrderItem|Product|Service [schema.org types: OrderItem, Product, Service] + * @inheritdoc */ - public $orderedItem; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['orderDelivery', 'orderItemNumber', 'orderItemStatus', 'orderQuantity', 'orderedItem'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderItemInterface.php b/src/models/jsonld/OrderItemInterface.php new file mode 100644 index 000000000..780530fae --- /dev/null +++ b/src/models/jsonld/OrderItemInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderPaymentDueInterface.php b/src/models/jsonld/OrderPaymentDueInterface.php new file mode 100644 index 000000000..9f0394117 --- /dev/null +++ b/src/models/jsonld/OrderPaymentDueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderPickupAvailableInterface.php b/src/models/jsonld/OrderPickupAvailableInterface.php new file mode 100644 index 000000000..9417cb038 --- /dev/null +++ b/src/models/jsonld/OrderPickupAvailableInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderProblemInterface.php b/src/models/jsonld/OrderProblemInterface.php new file mode 100644 index 000000000..e34ccca27 --- /dev/null +++ b/src/models/jsonld/OrderProblemInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderProcessingInterface.php b/src/models/jsonld/OrderProcessingInterface.php new file mode 100644 index 000000000..40d8ee0ff --- /dev/null +++ b/src/models/jsonld/OrderProcessingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderReturnedInterface.php b/src/models/jsonld/OrderReturnedInterface.php new file mode 100644 index 000000000..f394586f5 --- /dev/null +++ b/src/models/jsonld/OrderReturnedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrderStatusInterface.php b/src/models/jsonld/OrderStatusInterface.php new file mode 100644 index 000000000..c6e22220b --- /dev/null +++ b/src/models/jsonld/OrderStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrganizationInterface.php b/src/models/jsonld/OrganizationInterface.php new file mode 100644 index 000000000..a109caaa6 --- /dev/null +++ b/src/models/jsonld/OrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endDate' => ['Date', 'DateTime'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'namedPosition' => ['Text', 'URL'], + 'numberedPosition' => ['Number'], + 'potentialAction' => ['Action'], + 'roleName' => ['URL', 'Text'], + 'sameAs' => ['URL'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'numberedPosition' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'namedPosition' => 'A position played, performed or filled by a person or organization, as part of an organization. For example, an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + 'numberedPosition' => 'A number associated with a role in an organization, for example, the number on an athlete\'s jersey.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'roleName' => 'A role played, performed or filled by a person or organization. For example, the team of creators for a comic book might fill the roles named \'inker\', \'penciller\', and \'letterer\'; or an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'numberedPosition' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'numberedPosition' => 'A number associated with a role in an organization, for example, the number on an athlete\'s jersey.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A number associated with a role in an organization, for example, the number - * on an athlete's jersey. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $numberedPosition; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['numberedPosition'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrganizationRoleInterface.php b/src/models/jsonld/OrganizationRoleInterface.php new file mode 100644 index 000000000..901211698 --- /dev/null +++ b/src/models/jsonld/OrganizationRoleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OrganizeActionInterface.php b/src/models/jsonld/OrganizeActionInterface.php new file mode 100644 index 000000000..ed6de7e6a --- /dev/null +++ b/src/models/jsonld/OrganizeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/OriginalMediaContentInterface.php b/src/models/jsonld/OriginalMediaContentInterface.php new file mode 100644 index 000000000..d042c6a90 --- /dev/null +++ b/src/models/jsonld/OriginalMediaContentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OriginalShippingFeesInterface.php b/src/models/jsonld/OriginalShippingFeesInterface.php new file mode 100644 index 000000000..89d74519d --- /dev/null +++ b/src/models/jsonld/OriginalShippingFeesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OsteopathicInterface.php b/src/models/jsonld/OsteopathicInterface.php new file mode 100644 index 000000000..6a01bfd31 --- /dev/null +++ b/src/models/jsonld/OsteopathicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OtolaryngologicInterface.php b/src/models/jsonld/OtolaryngologicInterface.php new file mode 100644 index 000000000..c330b8775 --- /dev/null +++ b/src/models/jsonld/OtolaryngologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OutOfStockInterface.php b/src/models/jsonld/OutOfStockInterface.php new file mode 100644 index 000000000..313afdaee --- /dev/null +++ b/src/models/jsonld/OutOfStockInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OutletStoreInterface.php b/src/models/jsonld/OutletStoreInterface.php new file mode 100644 index 000000000..f70b3ef15 --- /dev/null +++ b/src/models/jsonld/OutletStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OverviewHealthAspectInterface.php b/src/models/jsonld/OverviewHealthAspectInterface.php new file mode 100644 index 000000000..20fd153f1 --- /dev/null +++ b/src/models/jsonld/OverviewHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acquiredFrom' => ['Organization', 'Person'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'ownedFrom' => ['DateTime'], + 'ownedThrough' => ['DateTime'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'typeOfGood' => ['Product', 'Service'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acquiredFrom', - 'ownedFrom', - 'ownedThrough', - 'typeOfGood' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acquiredFrom' => ['Organization', 'Person'], - 'ownedFrom' => ['DateTime'], - 'ownedThrough' => ['DateTime'], - 'typeOfGood' => ['Product', 'Service'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acquiredFrom' => 'The organization or person from which the product was acquired.', - 'ownedFrom' => 'The date and time of obtaining the product.', - 'ownedThrough' => 'The date and time of giving up ownership on the product.', - 'typeOfGood' => 'The product that this structured value is referring to.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acquiredFrom' => 'The organization or person from which the product was acquired.', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'ownedFrom' => 'The date and time of obtaining the product.', + 'ownedThrough' => 'The date and time of giving up ownership on the product.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'typeOfGood' => 'The product that this structured value is referring to.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The organization or person from which the product was acquired. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $acquiredFrom; - /** - * The date and time of obtaining the product. - * - * @var DateTime [schema.org types: DateTime] - */ - public $ownedFrom; - /** - * The date and time of giving up ownership on the product. - * - * @var DateTime [schema.org types: DateTime] - */ - public $ownedThrough; /** - * The product that this structured value is referring to. - * - * @var mixed|Product|Service [schema.org types: Product, Service] + * @inheritdoc */ - public $typeOfGood; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acquiredFrom', 'ownedFrom', 'ownedThrough', 'typeOfGood'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/OwnershipInfoInterface.php b/src/models/jsonld/OwnershipInfoInterface.php new file mode 100644 index 000000000..47e9d6743 --- /dev/null +++ b/src/models/jsonld/OwnershipInfoInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PETInterface.php b/src/models/jsonld/PETInterface.php new file mode 100644 index 000000000..844a053b7 --- /dev/null +++ b/src/models/jsonld/PETInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/PaidLeaveInterface.php b/src/models/jsonld/PaidLeaveInterface.php new file mode 100644 index 000000000..a708a5c56 --- /dev/null +++ b/src/models/jsonld/PaidLeaveInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaintActionInterface.php b/src/models/jsonld/PaintActionInterface.php new file mode 100644 index 000000000..1a180da9b --- /dev/null +++ b/src/models/jsonld/PaintActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaintingInterface.php b/src/models/jsonld/PaintingInterface.php new file mode 100644 index 000000000..174800436 --- /dev/null +++ b/src/models/jsonld/PaintingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'adverseOutcome' => ['MedicalEntity'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'contraindication' => ['Text', 'MedicalContraindication'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseSchedule' => ['DoseSchedule'], + 'drug' => ['Drug'], + 'duplicateTherapy' => ['MedicalTherapy'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'seriousAdverseOutcome' => ['MedicalEntity'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'contraindication', - 'duplicateTherapy', - 'seriousAdverseOutcome' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'contraindication' => ['MedicalContraindication', 'Text'], - 'duplicateTherapy' => ['MedicalTherapy'], - 'seriousAdverseOutcome' => ['MedicalEntity'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'contraindication' => 'A contraindication for this therapy.', - 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', - 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'contraindication' => 'A contraindication for this therapy.', + 'description' => 'A description of the item.', + '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.', + 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A contraindication for this therapy. - * - * @var mixed|MedicalContraindication|string [schema.org types: MedicalContraindication, Text] - */ - public $contraindication; - /** - * A therapy that duplicates or overlaps this one. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $duplicateTherapy; /** - * A possible serious complication and/or serious side effect of this therapy. - * Serious adverse outcomes include those that are life-threatening; result in - * death, disability, or permanent damage; require hospitalization or prolong - * existing hospitalization; cause congenital anomalies or birth defects; or - * jeopardize the patient and may require medical or surgical intervention to - * prevent one of the outcomes in this definition. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $seriousAdverseOutcome; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['contraindication', 'duplicateTherapy', 'seriousAdverseOutcome'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PalliativeProcedureInterface.php b/src/models/jsonld/PalliativeProcedureInterface.php new file mode 100644 index 000000000..0afb85199 --- /dev/null +++ b/src/models/jsonld/PalliativeProcedureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaperbackInterface.php b/src/models/jsonld/PaperbackInterface.php new file mode 100644 index 000000000..1e591982b --- /dev/null +++ b/src/models/jsonld/PaperbackInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'carrier' => ['Organization'], + 'deliveryAddress' => ['PostalAddress'], + 'deliveryStatus' => ['DeliveryEvent'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'expectedArrivalFrom' => ['Date', 'DateTime'], + 'expectedArrivalUntil' => ['Date', 'DateTime'], + 'hasDeliveryMethod' => ['DeliveryMethod'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itemShipped' => ['Product'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'originAddress' => ['PostalAddress'], + 'partOfOrder' => ['Order'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'trackingNumber' => ['Text'], + 'trackingUrl' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'deliveryAddress', - 'deliveryStatus', - 'expectedArrivalFrom', - 'expectedArrivalUntil', - 'hasDeliveryMethod', - 'itemShipped', - 'originAddress', - 'partOfOrder', - 'provider', - 'trackingNumber', - 'trackingUrl' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'deliveryAddress' => ['PostalAddress'], - 'deliveryStatus' => ['DeliveryEvent'], - 'expectedArrivalFrom' => ['Date', 'DateTime'], - 'expectedArrivalUntil' => ['Date', 'DateTime'], - 'hasDeliveryMethod' => ['DeliveryMethod'], - 'itemShipped' => ['Product'], - 'originAddress' => ['PostalAddress'], - 'partOfOrder' => ['Order'], - 'provider' => ['Organization', 'Person'], - 'trackingNumber' => ['Text'], - 'trackingUrl' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'deliveryAddress' => 'Destination address.', - 'deliveryStatus' => 'New entry added as the package passes through each leg of its journey (from shipment to final delivery).', - 'expectedArrivalFrom' => 'The earliest date the package may arrive.', - 'expectedArrivalUntil' => 'The latest date the package may arrive.', - 'hasDeliveryMethod' => 'Method used for delivery or shipping.', - 'itemShipped' => 'Item(s) being shipped.', - 'originAddress' => 'Shipper\'s address.', - 'partOfOrder' => 'The overall order the items in this delivery were included in.', - '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. Supersedes carrier.', - 'trackingNumber' => 'Shipper tracking number.', - 'trackingUrl' => 'Tracking url for the parcel delivery.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Destination address. - * - * @var PostalAddress [schema.org types: PostalAddress] - */ - public $deliveryAddress; - /** - * New entry added as the package passes through each leg of its journey (from - * shipment to final delivery). - * - * @var DeliveryEvent [schema.org types: DeliveryEvent] - */ - public $deliveryStatus; - /** - * The earliest date the package may arrive. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $expectedArrivalFrom; - /** - * The latest date the package may arrive. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $expectedArrivalUntil; - /** - * Method used for delivery or shipping. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] - */ - public $hasDeliveryMethod; - /** - * Item(s) being shipped. - * - * @var Product [schema.org types: Product] + * @inheritdoc */ - public $itemShipped; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'carrier' => '\'carrier\' is an out-dated term indicating the \'provider\' for parcel delivery and flights.', + 'deliveryAddress' => 'Destination address.', + 'deliveryStatus' => 'New entry added as the package passes through each leg of its journey (from shipment to final delivery).', + 'description' => 'A description of the item.', + '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.', + 'expectedArrivalFrom' => 'The earliest date the package may arrive.', + 'expectedArrivalUntil' => 'The latest date the package may arrive.', + 'hasDeliveryMethod' => 'Method used for delivery or shipping.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itemShipped' => 'Item(s) being shipped.', + '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.', + 'name' => 'The name of the item.', + 'originAddress' => 'Shipper\'s address.', + 'partOfOrder' => 'The overall order the items in this delivery were included in.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'trackingNumber' => 'Shipper tracking number.', + 'trackingUrl' => 'Tracking url for the parcel delivery.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Shipper's address. - * - * @var PostalAddress [schema.org types: PostalAddress] - */ - public $originAddress; - /** - * The overall order the items in this delivery were included in. - * - * @var Order [schema.org types: Order] - */ - public $partOfOrder; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * Shipper tracking number. - * - * @var string [schema.org types: Text] - */ - public $trackingNumber; /** - * Tracking url for the parcel delivery. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $trackingUrl; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['deliveryAddress', 'deliveryStatus', 'expectedArrivalFrom', 'expectedArrivalUntil', 'hasDeliveryMethod', 'itemShipped', 'originAddress', 'partOfOrder', 'provider', 'trackingNumber', 'trackingUrl'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ParcelDeliveryInterface.php b/src/models/jsonld/ParcelDeliveryInterface.php new file mode 100644 index 000000000..9c5be2c07 --- /dev/null +++ b/src/models/jsonld/ParcelDeliveryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ParcelServiceInterface.php b/src/models/jsonld/ParcelServiceInterface.php new file mode 100644 index 000000000..d0025b725 --- /dev/null +++ b/src/models/jsonld/ParcelServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'audienceType' => ['Text'], + 'childMaxAge' => ['Number'], + 'childMinAge' => ['Number'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'geographicArea' => ['AdministrativeArea'], + 'healthCondition' => ['MedicalCondition'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'requiredGender' => ['Text'], + 'requiredMaxAge' => ['Integer'], + 'requiredMinAge' => ['Integer'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'suggestedAge' => ['QuantitativeValue'], + 'suggestedGender' => ['GenderType', 'Text'], + 'suggestedMaxAge' => ['Number'], + 'suggestedMeasurement' => ['QuantitativeValue'], + 'suggestedMinAge' => ['Number'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'childMaxAge', - 'childMinAge' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'childMaxAge' => ['Number'], - 'childMinAge' => ['Number'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'audienceType' => 'The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).', + 'childMaxAge' => 'Maximal age of the child.', + 'childMinAge' => 'Minimal age of the child.', + 'description' => 'A description of the item.', + '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.', + 'geographicArea' => 'The geographic area associated with the audience.', + 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'requiredGender' => 'Audiences defined by a person\'s gender.', + 'requiredMaxAge' => 'Audiences defined by a person\'s maximum age.', + 'requiredMinAge' => 'Audiences defined by a person\'s minimum age.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'suggestedAge' => 'The age or age range for the intended audience or person, for example 3-12 months for infants, 1-5 years for toddlers.', + 'suggestedGender' => 'The suggested gender of the intended person or audience, for example "male", "female", or "unisex".', + 'suggestedMaxAge' => 'Maximum recommended age in years for the audience or user.', + 'suggestedMeasurement' => 'A suggested range of body measurements for the intended audience or person, for example inseam between 32 and 34 inches or height between 170 and 190 cm. Typically found on a size chart for wearable products.', + 'suggestedMinAge' => 'Minimum recommended age in years for the audience or user.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'childMaxAge' => 'Maximal age of the child.', - 'childMinAge' => 'Minimal age of the child.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Maximal age of the child. - * - * @var float [schema.org types: Number] - */ - public $childMaxAge; - /** - * Minimal age of the child. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $childMinAge; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['childMaxAge', 'childMinAge'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ParentAudienceInterface.php b/src/models/jsonld/ParentAudienceInterface.php new file mode 100644 index 000000000..c7b25412d --- /dev/null +++ b/src/models/jsonld/ParentAudienceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ParentalSupportInterface.php b/src/models/jsonld/ParentalSupportInterface.php new file mode 100644 index 000000000..0b2512c5c --- /dev/null +++ b/src/models/jsonld/ParentalSupportInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ParkInterface.php b/src/models/jsonld/ParkInterface.php new file mode 100644 index 000000000..607687320 --- /dev/null +++ b/src/models/jsonld/ParkInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ParkingFacilityInterface.php b/src/models/jsonld/ParkingFacilityInterface.php new file mode 100644 index 000000000..1eeb45cda --- /dev/null +++ b/src/models/jsonld/ParkingFacilityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ParkingMapInterface.php b/src/models/jsonld/ParkingMapInterface.php new file mode 100644 index 000000000..cc6d2ad78 --- /dev/null +++ b/src/models/jsonld/ParkingMapInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PartiallyInForceInterface.php b/src/models/jsonld/PartiallyInForceInterface.php new file mode 100644 index 000000000..db11aa17b --- /dev/null +++ b/src/models/jsonld/PartiallyInForceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PathologyInterface.php b/src/models/jsonld/PathologyInterface.php new file mode 100644 index 000000000..696b6ea88 --- /dev/null +++ b/src/models/jsonld/PathologyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'affectedBy' => ['Drug'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'normalRange' => ['Text', 'MedicalEnumeration'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'signDetected' => ['MedicalSign'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'tissueSample' => ['Text'], + 'url' => ['URL'], + 'usedToDiagnose' => ['MedicalCondition'], + 'usesDevice' => ['MedicalDevice'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'tissueSample' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'affectedBy' => 'Drugs that affect the test\'s results.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'normalRange' => 'Range of acceptable values for a typical patient, when applicable.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'signDetected' => 'A sign detected by the test.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'tissueSample' => 'The type of tissue sample required for the test.', + 'url' => 'URL of the item.', + 'usedToDiagnose' => 'A condition the test is used to diagnose.', + 'usesDevice' => 'Device used to perform the test.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'tissueSample' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'tissueSample' => 'The type of tissue sample required for the test.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The type of tissue sample required for the test. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $tissueSample; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['tissueSample'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PathologyTestInterface.php b/src/models/jsonld/PathologyTestInterface.php new file mode 100644 index 000000000..ff4b61205 --- /dev/null +++ b/src/models/jsonld/PathologyTestInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalName' => ['Text'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'affiliation' => ['Organization'], + 'alternateName' => ['Text'], + 'alumniOf' => ['EducationalOrganization', 'Organization'], + 'audienceType' => ['Text'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'birthDate' => ['Date'], + 'birthPlace' => ['Place'], + 'brand' => ['Organization', 'Brand'], + 'callSign' => ['Text'], + 'children' => ['Person'], + 'colleague' => ['Person', 'URL'], + 'colleagues' => ['Person'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'deathDate' => ['Date'], + 'deathPlace' => ['Place'], + 'description' => ['Text'], + 'diagnosis' => ['MedicalCondition'], + 'disambiguatingDescription' => ['Text'], + 'drug' => ['Drug'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'familyName' => ['Text'], + 'faxNumber' => ['Text'], + 'follows' => ['Person'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'gender' => ['GenderType', 'Text'], + 'geographicArea' => ['AdministrativeArea'], + 'givenName' => ['Text'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasOccupation' => ['Occupation'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthCondition' => ['MedicalCondition'], + 'height' => ['Distance', 'QuantitativeValue'], + 'homeLocation' => ['Place', 'ContactPoint'], + 'honorificPrefix' => ['Text'], + 'honorificSuffix' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'jobTitle' => ['Text', 'DefinedTerm'], + 'knows' => ['Person'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nationality' => ['Country'], + 'netWorth' => ['MonetaryAmount', 'PriceSpecification'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parent' => ['Person'], + 'parents' => ['Person'], + 'performerIn' => ['Event'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'relatedTo' => ['Person'], + 'requiredGender' => ['Text'], + 'requiredMaxAge' => ['Integer'], + 'requiredMinAge' => ['Integer'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'sibling' => ['Person'], + 'siblings' => ['Person'], + 'sponsor' => ['Organization', 'Person'], + 'spouse' => ['Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'suggestedAge' => ['QuantitativeValue'], + 'suggestedGender' => ['GenderType', 'Text'], + 'suggestedMaxAge' => ['Number'], + 'suggestedMeasurement' => ['QuantitativeValue'], + 'suggestedMinAge' => ['Number'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'url' => ['URL'], + 'vatID' => ['Text'], + 'weight' => ['QuantitativeValue'], + 'workLocation' => ['Place', 'ContactPoint'], + 'worksFor' => ['Organization'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'diagnosis', - 'drug', - 'healthCondition' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'diagnosis' => ['MedicalCondition'], - 'drug' => ['Drug'], - 'healthCondition' => ['MedicalCondition'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'diagnosis' => 'One or more alternative conditions considered in the differential diagnosis process as output of a diagnosis process.', - 'drug' => 'Specifying a drug or medicine used in a medication procedure', - 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalName' => 'An additional name for a Person, can be used for a middle name.', + '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.', + 'address' => 'Physical address of the item.', + 'affiliation' => 'An organization that this person is affiliated with. For example, a school/university, a club, or a team.', + 'alternateName' => 'An alias for the item.', + 'alumniOf' => 'An organization that the person is an alumni of.', + 'audienceType' => 'The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'birthDate' => 'Date of birth.', + 'birthPlace' => 'The place where the person was born.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'callSign' => 'A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', + 'children' => 'A child of the person.', + 'colleague' => 'A colleague of the person.', + 'colleagues' => 'A colleague of the person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'deathDate' => 'Date of death.', + 'deathPlace' => 'The place where the person died.', + 'description' => 'A description of the item.', + 'diagnosis' => 'One or more alternative conditions considered in the differential diagnosis process as output of a diagnosis process.', + '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.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'familyName' => 'Family name. In the U.S., the last name of a Person.', + 'faxNumber' => 'The fax number.', + 'follows' => 'The most generic uni-directional social relation.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gender' => 'Gender of something, typically a [[Person]], but possibly also fictional characters, animals, etc. While https://schema.org/Male and https://schema.org/Female may be used, text strings are also acceptable for people who do not identify as a binary gender. The [[gender]] property can also be used in an extended sense to cover e.g. the gender of sports teams. As with the gender of individuals, we do not try to enumerate all possibilities. A mixed-gender [[SportsTeam]] can be indicated with a text value of "Mixed".', + 'geographicArea' => 'The geographic area associated with the audience.', + 'givenName' => 'Given name. In the U.S., the first name of a Person.', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasOccupation' => 'The Person\'s occupation. For past professions, use Role for expressing dates.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.', + 'height' => 'The height of the item.', + 'homeLocation' => 'A contact location for a person\'s residence.', + 'honorificPrefix' => 'An honorific prefix preceding a Person\'s name such as Dr/Mrs/Mr.', + 'honorificSuffix' => 'An honorific suffix following a Person\'s name such as M.D. /PhD/MSCSW.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'jobTitle' => 'The job title of the person (for example, Financial Manager).', + 'knows' => 'The most generic bi-directional social/work relation.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nationality' => 'Nationality of the person.', + 'netWorth' => 'The total financial value of the person as calculated by subtracting assets from liabilities.', + 'owns' => 'Products owned by the organization or person.', + 'parent' => 'A parent of this person.', + 'parents' => 'A parents of the person.', + 'performerIn' => 'Event that this person is a performer or participant in.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'relatedTo' => 'The most generic familial relation.', + 'requiredGender' => 'Audiences defined by a person\'s gender.', + 'requiredMaxAge' => 'Audiences defined by a person\'s maximum age.', + 'requiredMinAge' => 'Audiences defined by a person\'s minimum age.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'sibling' => 'A sibling of the person.', + 'siblings' => 'A sibling of the person.', + '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.', + 'spouse' => 'The person\'s spouse.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'suggestedAge' => 'The age or age range for the intended audience or person, for example 3-12 months for infants, 1-5 years for toddlers.', + 'suggestedGender' => 'The suggested gender of the intended person or audience, for example "male", "female", or "unisex".', + 'suggestedMaxAge' => 'Maximum recommended age in years for the audience or user.', + 'suggestedMeasurement' => 'A suggested range of body measurements for the intended audience or person, for example inseam between 32 and 34 inches or height between 170 and 190 cm. Typically found on a size chart for wearable products.', + 'suggestedMinAge' => 'Minimum recommended age in years for the audience or user.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.', + 'weight' => 'The weight of the product or person.', + 'workLocation' => 'A contact location for a person\'s place of work.', + 'worksFor' => 'Organizations that the person works for.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * One or more alternative conditions considered in the differential diagnosis - * process as output of a diagnosis process. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $diagnosis; - /** - * Specifying a drug or medicine used in a medication procedure - * - * @var Drug [schema.org types: Drug] - */ - public $drug; /** - * Specifying the health condition(s) of a patient, medical study, or other - * target audience. - * - * @var MedicalCondition [schema.org types: MedicalCondition] + * @inheritdoc */ - public $healthCondition; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['diagnosis', 'drug', 'healthCondition'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PatientExperienceHealthAspect.php b/src/models/jsonld/PatientExperienceHealthAspect.php index 0062f7fa8..52bee6ea4 100644 --- a/src/models/jsonld/PatientExperienceHealthAspect.php +++ b/src/models/jsonld/PatientExperienceHealthAspect.php @@ -1,29 +1,29 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PatientExperienceHealthAspectInterface.php b/src/models/jsonld/PatientExperienceHealthAspectInterface.php new file mode 100644 index 000000000..13b75b810 --- /dev/null +++ b/src/models/jsonld/PatientExperienceHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PawnShopInterface.php b/src/models/jsonld/PawnShopInterface.php new file mode 100644 index 000000000..87d9ee038 --- /dev/null +++ b/src/models/jsonld/PawnShopInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'recipient' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PayActionInterface.php b/src/models/jsonld/PayActionInterface.php new file mode 100644 index 000000000..d783bc87e --- /dev/null +++ b/src/models/jsonld/PayActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentAutomaticallyAppliedInterface.php b/src/models/jsonld/PaymentAutomaticallyAppliedInterface.php new file mode 100644 index 000000000..5e927dd83 --- /dev/null +++ b/src/models/jsonld/PaymentAutomaticallyAppliedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'cashBack' => ['Number', 'Boolean'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'contactlessPayment' => ['Boolean'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'floorLimit' => ['MonetaryAmount'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'monthlyMinimumRepaymentAmount' => ['MonetaryAmount', 'Number'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cashBack', - 'contactlessPayment', - 'floorLimit' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'cashBack' => ['Boolean', 'Number'], - 'contactlessPayment' => ['Boolean'], - 'floorLimit' => ['MonetaryAmount'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'cashBack' => 'A cardholder benefit that pays the cardholder a small percentage of their net expenditures.', - 'contactlessPayment' => 'A secure method for consumers to purchase products or services via debit, credit or smartcards by using RFID or NFC technology.', - 'floorLimit' => 'A floor limit is the amount of money above which credit card transactions must be authorized.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'cashBack' => 'A cardholder benefit that pays the cardholder a small percentage of their net expenditures.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'contactlessPayment' => 'A secure method for consumers to purchase products or services via debit, credit or smartcards by using RFID or NFC technology.', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'floorLimit' => 'A floor limit is the amount of money above which credit card transactions must be authorized.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'monthlyMinimumRepaymentAmount' => 'The minimum payment is the lowest amount of money that one is required to pay on a credit card statement each month.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A cardholder benefit that pays the cardholder a small percentage of their - * net expenditures. - * - * @var mixed|bool|float [schema.org types: Boolean, Number] - */ - public $cashBack; - /** - * A secure method for consumers to purchase products or services via debit, - * credit or smartcards by using RFID or NFC technology. - * - * @var bool [schema.org types: Boolean] - */ - public $contactlessPayment; /** - * A floor limit is the amount of money above which credit card transactions - * must be authorized. - * - * @var MonetaryAmount [schema.org types: MonetaryAmount] + * @inheritdoc */ - public $floorLimit; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cashBack', 'contactlessPayment', 'floorLimit'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentCardInterface.php b/src/models/jsonld/PaymentCardInterface.php new file mode 100644 index 000000000..04caaf8ed --- /dev/null +++ b/src/models/jsonld/PaymentCardInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'appliesToDeliveryMethod' => ['DeliveryMethod'], + 'appliesToPaymentMethod' => ['PaymentMethod'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxPrice' => ['Number'], + 'minPrice' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'valueAddedTaxIncluded' => ['Boolean'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'appliesToDeliveryMethod', - 'appliesToPaymentMethod' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'appliesToDeliveryMethod' => ['DeliveryMethod'], - 'appliesToPaymentMethod' => ['PaymentMethod'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'appliesToDeliveryMethod' => 'The delivery method(s) to which the delivery charge or payment charge specification applies.', + 'appliesToPaymentMethod' => 'The payment method(s) to which the payment charge specification applies.', + 'description' => 'A description of the item.', + '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.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maxPrice' => 'The highest price if the price is a range.', + 'minPrice' => 'The lowest price if the price is a range.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'valueAddedTaxIncluded' => 'Specifies whether the applicable value-added tax (VAT) is included in the price specification or not.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'appliesToDeliveryMethod' => 'The delivery method(s) to which the delivery charge or payment charge specification applies.', - 'appliesToPaymentMethod' => 'The payment method(s) to which the payment charge specification applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The delivery method(s) to which the delivery charge or payment charge - * specification applies. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] - */ - public $appliesToDeliveryMethod; - /** - * The payment method(s) to which the payment charge specification applies. - * - * @var PaymentMethod [schema.org types: PaymentMethod] + * @inheritdoc */ - public $appliesToPaymentMethod; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['appliesToDeliveryMethod', 'appliesToPaymentMethod'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentChargeSpecificationInterface.php b/src/models/jsonld/PaymentChargeSpecificationInterface.php new file mode 100644 index 000000000..ad5ef9624 --- /dev/null +++ b/src/models/jsonld/PaymentChargeSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentCompleteInterface.php b/src/models/jsonld/PaymentCompleteInterface.php new file mode 100644 index 000000000..d6e6ea3f7 --- /dev/null +++ b/src/models/jsonld/PaymentCompleteInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentDeclinedInterface.php b/src/models/jsonld/PaymentDeclinedInterface.php new file mode 100644 index 000000000..3be4e3ed0 --- /dev/null +++ b/src/models/jsonld/PaymentDeclinedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentDueInterface.php b/src/models/jsonld/PaymentDueInterface.php new file mode 100644 index 000000000..0dec884aa --- /dev/null +++ b/src/models/jsonld/PaymentDueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentMethodInterface.php b/src/models/jsonld/PaymentMethodInterface.php new file mode 100644 index 000000000..b2861e4c8 --- /dev/null +++ b/src/models/jsonld/PaymentMethodInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentPastDueInterface.php b/src/models/jsonld/PaymentPastDueInterface.php new file mode 100644 index 000000000..a39eb85e5 --- /dev/null +++ b/src/models/jsonld/PaymentPastDueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'annualPercentageRate' => ['Number', 'QuantitativeValue'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'feesAndCommissionsSpecification' => ['URL', 'Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interestRate' => ['Number', 'QuantitativeValue'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'annualPercentageRate', - 'feesAndCommissionsSpecification', - 'interestRate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'annualPercentageRate' => ['Number', 'QuantitativeValue'], - 'feesAndCommissionsSpecification' => ['Text', 'URL'], - 'interestRate' => ['Number', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', - 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', - 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'annualPercentageRate' => 'The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'feesAndCommissionsSpecification' => 'Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interestRate' => 'The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The annual rate that is charged for borrowing (or made by investing), - * expressed as a single percentage number that represents the actual yearly - * cost of funds over the term of a loan. This includes any fees or additional - * costs associated with the transaction. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $annualPercentageRate; - /** - * Description of fees, commissions, and other terms applied either to a class - * of financial product, or by a financial service organization. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $feesAndCommissionsSpecification; /** - * The interest rate, charged or paid, applicable to the financial product. - * Note: This is different from the calculated annualPercentageRate. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] + * @inheritdoc */ - public $interestRate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['annualPercentageRate', 'feesAndCommissionsSpecification', 'interestRate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentServiceInterface.php b/src/models/jsonld/PaymentServiceInterface.php new file mode 100644 index 000000000..be679bef7 --- /dev/null +++ b/src/models/jsonld/PaymentServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PaymentStatusTypeInterface.php b/src/models/jsonld/PaymentStatusTypeInterface.php new file mode 100644 index 000000000..939bacd20 --- /dev/null +++ b/src/models/jsonld/PaymentStatusTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PediatricInterface.php b/src/models/jsonld/PediatricInterface.php new file mode 100644 index 000000000..e653c462d --- /dev/null +++ b/src/models/jsonld/PediatricInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'audienceType' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'geographicArea' => ['AdministrativeArea'], + 'healthCondition' => ['MedicalCondition'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'requiredGender' => ['Text'], + 'requiredMaxAge' => ['Integer'], + 'requiredMinAge' => ['Integer'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'suggestedAge' => ['QuantitativeValue'], + 'suggestedGender' => ['GenderType', 'Text'], + 'suggestedMaxAge' => ['Number'], + 'suggestedMeasurement' => ['QuantitativeValue'], + 'suggestedMinAge' => ['Number'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'healthCondition', - 'requiredGender', - 'requiredMaxAge', - 'requiredMinAge', - 'suggestedGender', - 'suggestedMaxAge', - 'suggestedMinAge' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'healthCondition' => ['MedicalCondition'], - 'requiredGender' => ['Text'], - 'requiredMaxAge' => ['Integer'], - 'requiredMinAge' => ['Integer'], - 'suggestedGender' => ['Text'], - 'suggestedMaxAge' => ['Number'], - 'suggestedMinAge' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.', - 'requiredGender' => 'Audiences defined by a person\'s gender.', - 'requiredMaxAge' => 'Audiences defined by a person\'s maximum age.', - 'requiredMinAge' => 'Audiences defined by a person\'s minimum age.', - 'suggestedGender' => 'The gender of the person or audience.', - 'suggestedMaxAge' => 'Maximal age recommended for viewing content.', - 'suggestedMinAge' => 'Minimal age recommended for viewing content.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Specifying the health condition(s) of a patient, medical study, or other - * target audience. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $healthCondition; - /** - * Audiences defined by a person's gender. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $requiredGender; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'audienceType' => 'The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).', + 'description' => 'A description of the item.', + '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.', + 'geographicArea' => 'The geographic area associated with the audience.', + 'healthCondition' => 'Specifying the health condition(s) of a patient, medical study, or other target audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'requiredGender' => 'Audiences defined by a person\'s gender.', + 'requiredMaxAge' => 'Audiences defined by a person\'s maximum age.', + 'requiredMinAge' => 'Audiences defined by a person\'s minimum age.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'suggestedAge' => 'The age or age range for the intended audience or person, for example 3-12 months for infants, 1-5 years for toddlers.', + 'suggestedGender' => 'The suggested gender of the intended person or audience, for example "male", "female", or "unisex".', + 'suggestedMaxAge' => 'Maximum recommended age in years for the audience or user.', + 'suggestedMeasurement' => 'A suggested range of body measurements for the intended audience or person, for example inseam between 32 and 34 inches or height between 170 and 190 cm. Typically found on a size chart for wearable products.', + 'suggestedMinAge' => 'Minimum recommended age in years for the audience or user.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Audiences defined by a person's maximum age. - * - * @var int [schema.org types: Integer] - */ - public $requiredMaxAge; - /** - * Audiences defined by a person's minimum age. - * - * @var int [schema.org types: Integer] - */ - public $requiredMinAge; - /** - * The gender of the person or audience. - * - * @var string [schema.org types: Text] - */ - public $suggestedGender; - /** - * Maximal age recommended for viewing content. - * - * @var float [schema.org types: Number] - */ - public $suggestedMaxAge; /** - * Minimal age recommended for viewing content. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $suggestedMinAge; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['healthCondition', 'requiredGender', 'requiredMaxAge', 'requiredMinAge', 'suggestedGender', 'suggestedMaxAge', 'suggestedMinAge'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PeopleAudienceInterface.php b/src/models/jsonld/PeopleAudienceInterface.php new file mode 100644 index 000000000..b15866cb5 --- /dev/null +++ b/src/models/jsonld/PeopleAudienceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PercutaneousProcedureInterface.php b/src/models/jsonld/PercutaneousProcedureInterface.php new file mode 100644 index 000000000..bcd2d3298 --- /dev/null +++ b/src/models/jsonld/PercutaneousProcedureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'entertainmentBusiness' => ['EntertainmentBusiness'], + 'error' => ['Thing'], + 'event' => ['Event'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'entertainmentBusiness' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'entertainmentBusiness' => 'A sub property of location. The entertainment business where the action occurred.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'entertainmentBusiness' => ['EntertainmentBusiness'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'entertainmentBusiness' => 'A sub property of location. The entertainment business where the action occurred.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The entertainment business where the action - * occurred. - * - * @var EntertainmentBusiness [schema.org types: EntertainmentBusiness] + * @inheritdoc */ - public $entertainmentBusiness; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['entertainmentBusiness'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PerformActionInterface.php b/src/models/jsonld/PerformActionInterface.php new file mode 100644 index 000000000..645c0d52d --- /dev/null +++ b/src/models/jsonld/PerformActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'characterName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endDate' => ['Date', 'DateTime'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'namedPosition' => ['Text', 'URL'], + 'potentialAction' => ['Action'], + 'roleName' => ['URL', 'Text'], + 'sameAs' => ['URL'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'characterName' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'characterName' => 'The name of a character played in some acting or performing role, i.e. in a PerformanceRole.', + 'description' => 'A description of the item.', + '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.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'namedPosition' => 'A position played, performed or filled by a person or organization, as part of an organization. For example, an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'roleName' => 'A role played, performed or filled by a person or organization. For example, the team of creators for a comic book might fill the roles named \'inker\', \'penciller\', and \'letterer\'; or an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'characterName' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'characterName' => 'The name of a character played in some acting or performing role, i.e. in a PerformanceRole.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The name of a character played in some acting or performing role, i.e. in a - * PerformanceRole. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $characterName; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['characterName'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PerformanceRoleInterface.php b/src/models/jsonld/PerformanceRoleInterface.php new file mode 100644 index 000000000..454d69415 --- /dev/null +++ b/src/models/jsonld/PerformanceRoleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PerformingArtsTheaterInterface.php b/src/models/jsonld/PerformingArtsTheaterInterface.php new file mode 100644 index 000000000..d5c07319b --- /dev/null +++ b/src/models/jsonld/PerformingArtsTheaterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PerformingGroupInterface.php b/src/models/jsonld/PerformingGroupInterface.php new file mode 100644 index 000000000..1cda31137 --- /dev/null +++ b/src/models/jsonld/PerformingGroupInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'endDate', - 'issn', - 'startDate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'endDate' => ['Date', 'DateTime'], - 'issn' => ['Text'], - 'startDate' => ['Date', 'DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The International Standard Serial Number (ISSN) that identifies this serial - * publication. You can repeat this property to identify different formats of, - * or the linking ISSN (ISSN-L) for, this serial publication. - * - * @var string [schema.org types: Text] - */ - public $issn; /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $startDate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['endDate', 'issn', 'startDate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PeriodicalInterface.php b/src/models/jsonld/PeriodicalInterface.php new file mode 100644 index 000000000..6a0c3e427 --- /dev/null +++ b/src/models/jsonld/PeriodicalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'issuedBy' => ['Organization'], + 'issuedThrough' => ['Service'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'permitAudience' => ['Audience'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFor' => ['Duration'], + 'validFrom' => ['DateTime', 'Date'], + 'validIn' => ['AdministrativeArea'], + 'validUntil' => ['Date'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'issuedBy', - 'issuedThrough', - 'permitAudience', - 'validFor', - 'validFrom', - 'validIn', - 'validUntil' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'issuedBy' => ['Organization'], - 'issuedThrough' => ['Service'], - 'permitAudience' => ['Audience'], - 'validFor' => ['Duration'], - 'validFrom' => ['Date', 'DateTime'], - 'validIn' => ['AdministrativeArea'], - 'validUntil' => ['Date'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'issuedBy' => 'The organization issuing the ticket or permit.', - 'issuedThrough' => 'The service through with the permit was granted.', - 'permitAudience' => 'The target audience for this permit.', - 'validFor' => 'The duration of validity of a permit or similar thing.', - 'validFrom' => 'The date when the item becomes valid.', - 'validIn' => 'The geographic area where a permit or similar thing is valid.', - 'validUntil' => 'The date when the item is no longer valid.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The organization issuing the ticket or permit. - * - * @var Organization [schema.org types: Organization] - */ - public $issuedBy; - /** - * The service through with the permit was granted. - * - * @var Service [schema.org types: Service] + * @inheritdoc */ - public $issuedThrough; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'issuedBy' => 'The organization issuing the ticket or permit.', + 'issuedThrough' => 'The service through with the permit was granted.', + '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.', + 'name' => 'The name of the item.', + 'permitAudience' => 'The target audience for this permit.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFor' => 'The duration of validity of a permit or similar thing.', + 'validFrom' => 'The date when the item becomes valid.', + 'validIn' => 'The geographic area where a permit or similar thing is valid.', + 'validUntil' => 'The date when the item is no longer valid.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The target audience for this permit. - * - * @var Audience [schema.org types: Audience] - */ - public $permitAudience; - /** - * The duration of validity of a permit or similar thing. - * - * @var Duration [schema.org types: Duration] - */ - public $validFor; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; - /** - * The geographic area where a permit or similar thing is valid. - * - * @var AdministrativeArea [schema.org types: AdministrativeArea] - */ - public $validIn; /** - * The date when the item is no longer valid. - * - * @var Date [schema.org types: Date] + * @inheritdoc */ - public $validUntil; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['issuedBy', 'issuedThrough', 'permitAudience', 'validFor', 'validFrom', 'validIn', 'validUntil'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PermitInterface.php b/src/models/jsonld/PermitInterface.php new file mode 100644 index 000000000..5c931b12c --- /dev/null +++ b/src/models/jsonld/PermitInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalName' => ['Text'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'affiliation' => ['Organization'], + 'alternateName' => ['Text'], + 'alumniOf' => ['EducationalOrganization', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'birthDate' => ['Date'], + 'birthPlace' => ['Place'], + 'brand' => ['Organization', 'Brand'], + 'callSign' => ['Text'], + 'children' => ['Person'], + 'colleague' => ['Person', 'URL'], + 'colleagues' => ['Person'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'deathDate' => ['Date'], + 'deathPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'familyName' => ['Text'], + 'faxNumber' => ['Text'], + 'follows' => ['Person'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'gender' => ['GenderType', 'Text'], + 'givenName' => ['Text'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasOccupation' => ['Occupation'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'height' => ['Distance', 'QuantitativeValue'], + 'homeLocation' => ['Place', 'ContactPoint'], + 'honorificPrefix' => ['Text'], + 'honorificSuffix' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'jobTitle' => ['Text', 'DefinedTerm'], + 'knows' => ['Person'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nationality' => ['Country'], + 'netWorth' => ['MonetaryAmount', 'PriceSpecification'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parent' => ['Person'], + 'parents' => ['Person'], + 'performerIn' => ['Event'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'relatedTo' => ['Person'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'sibling' => ['Person'], + 'siblings' => ['Person'], + 'sponsor' => ['Organization', 'Person'], + 'spouse' => ['Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'url' => ['URL'], + 'vatID' => ['Text'], + 'weight' => ['QuantitativeValue'], + 'workLocation' => ['Place', 'ContactPoint'], + 'worksFor' => ['Organization'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalName', - 'address', - 'affiliation', - 'alumniOf', - 'award', - 'birthDate', - 'birthPlace', - 'brand', - 'callSign', - 'children', - 'colleague', - 'contactPoint', - 'deathDate', - 'deathPlace', - 'duns', - 'email', - 'familyName', - 'faxNumber', - 'follows', - 'funder', - 'gender', - 'givenName', - 'globalLocationNumber', - 'hasCredential', - 'hasOccupation', - 'hasOfferCatalog', - 'hasPOS', - 'height', - 'homeLocation', - 'honorificPrefix', - 'honorificSuffix', - 'interactionStatistic', - 'isicV4', - 'jobTitle', - 'knows', - 'knowsAbout', - 'knowsLanguage', - 'makesOffer', - 'memberOf', - 'naics', - 'nationality', - 'netWorth', - 'owns', - 'parent', - 'performerIn', - 'publishingPrinciples', - 'relatedTo', - 'seeks', - 'sibling', - 'sponsor', - 'spouse', - 'taxID', - 'telephone', - 'vatID', - 'weight', - 'workLocation', - 'worksFor' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalName' => ['Text'], - 'address' => ['PostalAddress', 'Text'], - 'affiliation' => ['Organization'], - 'alumniOf' => ['EducationalOrganization', 'Organization'], - 'award' => ['Text'], - 'birthDate' => ['Date'], - 'birthPlace' => ['Place'], - 'brand' => ['Brand', 'Organization'], - 'callSign' => ['Text'], - 'children' => ['Person'], - 'colleague' => ['Person', 'URL'], - 'contactPoint' => ['ContactPoint'], - 'deathDate' => ['Date'], - 'deathPlace' => ['Place'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'familyName' => ['Text'], - 'faxNumber' => ['Text'], - 'follows' => ['Person'], - 'funder' => ['Organization', 'Person'], - 'gender' => ['GenderType', 'Text'], - 'givenName' => ['Text'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasOccupation' => ['Occupation'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'height' => ['Distance', 'QuantitativeValue'], - 'homeLocation' => ['ContactPoint', 'Place'], - 'honorificPrefix' => ['Text'], - 'honorificSuffix' => ['Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'jobTitle' => ['DefinedTerm', 'Text'], - 'knows' => ['Person'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'makesOffer' => ['Offer'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'nationality' => ['Country'], - 'netWorth' => ['MonetaryAmount', 'PriceSpecification'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parent' => ['Person'], - 'performerIn' => ['Event'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'relatedTo' => ['Person'], - 'seeks' => ['Demand'], - 'sibling' => ['Person'], - 'sponsor' => ['Organization', 'Person'], - 'spouse' => ['Person'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'vatID' => ['Text'], - 'weight' => ['QuantitativeValue'], - 'workLocation' => ['ContactPoint', 'Place'], - 'worksFor' => ['Organization'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalName' => 'An additional name for a Person, can be used for a middle name.', - 'address' => 'Physical address of the item.', - 'affiliation' => 'An organization that this person is affiliated with. For example, a school/university, a club, or a team.', - 'alumniOf' => 'An organization that the person is an alumni of. Inverse property: alumni.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'birthDate' => 'Date of birth.', - 'birthPlace' => 'The place where the person was born.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'callSign' => 'A callsign, as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', - 'children' => 'A child of the person.', - 'colleague' => 'A colleague of the person. Supersedes colleagues.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'deathDate' => 'Date of death.', - 'deathPlace' => 'The place where the person died.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'familyName' => 'Family name. In the U.S., the last name of an Person. This can be used along with givenName instead of the name property.', - 'faxNumber' => 'The fax number.', - 'follows' => 'The most generic uni-directional social relation.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'gender' => 'Gender of something, typically a Person, but possibly also fictional characters, animals, etc. While http://schema.org/Male and http://schema.org/Female may be used, text strings are also acceptable for people who do not identify as a binary gender. The gender property can also be used in an extended sense to cover e.g. the gender of sports teams. As with the gender of individuals, we do not try to enumerate all possibilities. A mixed-gender SportsTeam can be indicated with a text value of "Mixed".', - 'givenName' => 'Given name. In the U.S., the first name of a Person. This can be used along with familyName instead of the name property.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasOccupation' => 'The Person\'s occupation. For past professions, use Role for expressing dates.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'height' => 'The height of the item.', - 'homeLocation' => 'A contact location for a person\'s residence.', - 'honorificPrefix' => 'An honorific prefix preceding a Person\'s name such as Dr/Mrs/Mr.', - 'honorificSuffix' => 'An honorific suffix preceding a Person\'s name such as M.D. /PhD/MSCSW.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'jobTitle' => 'The job title of the person (for example, Financial Manager).', - 'knows' => 'The most generic bi-directional social/work relation.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'nationality' => 'Nationality of the person.', - 'netWorth' => 'The total financial value of the person as calculated by subtracting assets from liabilities.', - 'owns' => 'Products owned by the organization or person.', - 'parent' => 'A parent of this person. Supersedes parents.', - 'performerIn' => 'Event that this person is a performer or participant in.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'relatedTo' => 'The most generic familial relation.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'sibling' => 'A sibling of the person. Supersedes siblings.', - '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.', - 'spouse' => 'The person\'s spouse.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'vatID' => 'The Value-added Tax ID of the organization or person.', - 'weight' => 'The weight of the product or person.', - 'workLocation' => 'A contact location for a person\'s place of work.', - 'worksFor' => 'Organizations that the person works for.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An additional name for a Person, can be used for a middle name. - * - * @var string [schema.org types: Text] - */ - public $additionalName; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * An organization that this person is affiliated with. For example, a - * school/university, a club, or a team. - * - * @var Organization [schema.org types: Organization] - */ - public $affiliation; - /** - * An organization that the person is an alumni of. Inverse property: alumni. - * - * @var mixed|EducationalOrganization|Organization [schema.org types: EducationalOrganization, Organization] - */ - public $alumniOf; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Date of birth. - * - * @var Date [schema.org types: Date] - */ - public $birthDate; - /** - * The place where the person was born. - * - * @var Place [schema.org types: Place] - */ - public $birthPlace; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A callsign, as used in broadcasting and radio communications to identify - * people, radio and TV stations, or vehicles. - * - * @var string [schema.org types: Text] - */ - public $callSign; - /** - * A child of the person. - * - * @var Person [schema.org types: Person] - */ - public $children; /** - * A colleague of the person. Supersedes colleagues. - * - * @var mixed|Person|string [schema.org types: Person, URL] - */ - public $colleague; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * Date of death. - * - * @var Date [schema.org types: Date] - */ - public $deathDate; - /** - * The place where the person died. - * - * @var Place [schema.org types: Place] - */ - public $deathPlace; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Family name. In the U.S., the last name of an Person. This can be used - * along with givenName instead of the name property. - * - * @var string [schema.org types: Text] - */ - public $familyName; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The most generic uni-directional social relation. - * - * @var Person [schema.org types: Person] - */ - public $follows; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Gender of something, typically a Person, but possibly also fictional - * characters, animals, etc. While http://schema.org/Male and - * http://schema.org/Female may be used, text strings are also acceptable for - * people who do not identify as a binary gender. The gender property can also - * be used in an extended sense to cover e.g. the gender of sports teams. As - * with the gender of individuals, we do not try to enumerate all - * possibilities. A mixed-gender SportsTeam can be indicated with a text value - * of "Mixed". - * - * @var mixed|GenderType|string [schema.org types: GenderType, Text] - */ - public $gender; - /** - * Given name. In the U.S., the first name of a Person. This can be used along - * with familyName instead of the name property. - * - * @var string [schema.org types: Text] - */ - public $givenName; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * The Person's occupation. For past professions, use Role for expressing - * dates. - * - * @var Occupation [schema.org types: Occupation] - */ - public $hasOccupation; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The height of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] - */ - public $height; - /** - * A contact location for a person's residence. - * - * @var mixed|ContactPoint|Place [schema.org types: ContactPoint, Place] - */ - public $homeLocation; - /** - * An honorific prefix preceding a Person's name such as Dr/Mrs/Mr. - * - * @var string [schema.org types: Text] - */ - public $honorificPrefix; - /** - * An honorific suffix preceding a Person's name such as M.D. /PhD/MSCSW. - * - * @var string [schema.org types: Text] - */ - public $honorificSuffix; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The job title of the person (for example, Financial Manager). - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $jobTitle; - /** - * The most generic bi-directional social/work relation. - * - * @var Person [schema.org types: Person] - */ - public $knows; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * Nationality of the person. - * - * @var Country [schema.org types: Country] - */ - public $nationality; - /** - * The total financial value of the person as calculated by subtracting assets - * from liabilities. - * - * @var mixed|MonetaryAmount|PriceSpecification [schema.org types: MonetaryAmount, PriceSpecification] - */ - public $netWorth; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * A parent of this person. Supersedes parents. - * - * @var Person [schema.org types: Person] - */ - public $parent; - /** - * Event that this person is a performer or participant in. - * - * @var Event [schema.org types: Event] - */ - public $performerIn; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The most generic familial relation. - * - * @var Person [schema.org types: Person] - */ - public $relatedTo; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A sibling of the person. Supersedes siblings. - * - * @var Person [schema.org types: Person] - */ - public $sibling; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The person's spouse. - * - * @var Person [schema.org types: Person] - */ - public $spouse; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $taxID; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalName' => 'An additional name for a Person, can be used for a middle name.', + '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.', + 'address' => 'Physical address of the item.', + 'affiliation' => 'An organization that this person is affiliated with. For example, a school/university, a club, or a team.', + 'alternateName' => 'An alias for the item.', + 'alumniOf' => 'An organization that the person is an alumni of.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'birthDate' => 'Date of birth.', + 'birthPlace' => 'The place where the person was born.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'callSign' => 'A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', + 'children' => 'A child of the person.', + 'colleague' => 'A colleague of the person.', + 'colleagues' => 'A colleague of the person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'deathDate' => 'Date of death.', + 'deathPlace' => 'The place where the person died.', + 'description' => 'A description of the item.', + '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.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'familyName' => 'Family name. In the U.S., the last name of a Person.', + 'faxNumber' => 'The fax number.', + 'follows' => 'The most generic uni-directional social relation.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gender' => 'Gender of something, typically a [[Person]], but possibly also fictional characters, animals, etc. While https://schema.org/Male and https://schema.org/Female may be used, text strings are also acceptable for people who do not identify as a binary gender. The [[gender]] property can also be used in an extended sense to cover e.g. the gender of sports teams. As with the gender of individuals, we do not try to enumerate all possibilities. A mixed-gender [[SportsTeam]] can be indicated with a text value of "Mixed".', + 'givenName' => 'Given name. In the U.S., the first name of a Person.', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasOccupation' => 'The Person\'s occupation. For past professions, use Role for expressing dates.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'height' => 'The height of the item.', + 'homeLocation' => 'A contact location for a person\'s residence.', + 'honorificPrefix' => 'An honorific prefix preceding a Person\'s name such as Dr/Mrs/Mr.', + 'honorificSuffix' => 'An honorific suffix following a Person\'s name such as M.D. /PhD/MSCSW.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'jobTitle' => 'The job title of the person (for example, Financial Manager).', + 'knows' => 'The most generic bi-directional social/work relation.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nationality' => 'Nationality of the person.', + 'netWorth' => 'The total financial value of the person as calculated by subtracting assets from liabilities.', + 'owns' => 'Products owned by the organization or person.', + 'parent' => 'A parent of this person.', + 'parents' => 'A parents of the person.', + 'performerIn' => 'Event that this person is a performer or participant in.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'relatedTo' => 'The most generic familial relation.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'sibling' => 'A sibling of the person.', + 'siblings' => 'A sibling of the person.', + '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.', + 'spouse' => 'The person\'s spouse.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.', + 'weight' => 'The weight of the product or person.', + 'workLocation' => 'A contact location for a person\'s place of work.', + 'worksFor' => 'Organizations that the person works for.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] - */ - public $vatID; - /** - * The weight of the product or person. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $weight; /** - * A contact location for a person's place of work. - * - * @var mixed|ContactPoint|Place [schema.org types: ContactPoint, Place] - */ - public $workLocation; - /** - * Organizations that the person works for. - * - * @var Organization [schema.org types: Organization] + * @inheritdoc */ - public $worksFor; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalName', 'address', 'affiliation', 'alumniOf', 'award', 'birthDate', 'birthPlace', 'brand', 'callSign', 'children', 'colleague', 'contactPoint', 'deathDate', 'deathPlace', 'duns', 'email', 'familyName', 'faxNumber', 'follows', 'funder', 'gender', 'givenName', 'globalLocationNumber', 'hasCredential', 'hasOccupation', 'hasOfferCatalog', 'hasPOS', 'height', 'homeLocation', 'honorificPrefix', 'honorificSuffix', 'interactionStatistic', 'isicV4', 'jobTitle', 'knows', 'knowsAbout', 'knowsLanguage', 'makesOffer', 'memberOf', 'naics', 'nationality', 'netWorth', 'owns', 'parent', 'performerIn', 'publishingPrinciples', 'relatedTo', 'seeks', 'sibling', 'sponsor', 'spouse', 'taxID', 'telephone', 'vatID', 'weight', 'workLocation', 'worksFor'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PersonInterface.php b/src/models/jsonld/PersonInterface.php new file mode 100644 index 000000000..6651d07d2 --- /dev/null +++ b/src/models/jsonld/PersonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PetStoreInterface.php b/src/models/jsonld/PetStoreInterface.php new file mode 100644 index 000000000..dcd872ca9 --- /dev/null +++ b/src/models/jsonld/PetStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthPlanNetworkId' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAcceptingNewPatients' => ['Boolean'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'medicalSpecialty' => ['MedicalSpecialty'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'medicalSpecialty' => 'A medical specialty of the provider.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PharmacyInterface.php b/src/models/jsonld/PharmacyInterface.php new file mode 100644 index 000000000..29b2769cd --- /dev/null +++ b/src/models/jsonld/PharmacyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PharmacySpecialtyInterface.php b/src/models/jsonld/PharmacySpecialtyInterface.php new file mode 100644 index 000000000..39a7633e0 --- /dev/null +++ b/src/models/jsonld/PharmacySpecialtyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PhotographAction.php b/src/models/jsonld/PhotographAction.php index 5921a1fcb..4f124fa0a 100644 --- a/src/models/jsonld/PhotographAction.php +++ b/src/models/jsonld/PhotographAction.php @@ -1,28 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PhotographActionInterface.php b/src/models/jsonld/PhotographActionInterface.php new file mode 100644 index 000000000..940e6c5de --- /dev/null +++ b/src/models/jsonld/PhotographActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'epidemiology' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'pathophysiology' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedAnatomy', - 'category', - 'epidemiology', - 'pathophysiology' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'epidemiology' => ['Text'], - 'pathophysiology' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', - 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The anatomy of the underlying organ system or structures associated with - * this entity. - * - * @var mixed|AnatomicalStructure|AnatomicalSystem|SuperficialAnatomy [schema.org types: AnatomicalStructure, AnatomicalSystem, SuperficialAnatomy] - */ - public $associatedAnatomy; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * The characteristics of associated patients, such as age, gender, race etc. - * - * @var string [schema.org types: Text] - */ - public $epidemiology; /** - * Changes in the normal mechanical, physical, and biochemical functions that - * are associated with this activity or condition. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $pathophysiology; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedAnatomy', 'category', 'epidemiology', 'pathophysiology'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PhysicalActivityCategory.php b/src/models/jsonld/PhysicalActivityCategory.php index 55a7a56b6..751d289e5 100644 --- a/src/models/jsonld/PhysicalActivityCategory.php +++ b/src/models/jsonld/PhysicalActivityCategory.php @@ -1,28 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PhysicalActivityCategoryInterface.php b/src/models/jsonld/PhysicalActivityCategoryInterface.php new file mode 100644 index 000000000..e6a5f9a0b --- /dev/null +++ b/src/models/jsonld/PhysicalActivityCategoryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PhysicalExamInterface.php b/src/models/jsonld/PhysicalExamInterface.php new file mode 100644 index 000000000..b60a8247c --- /dev/null +++ b/src/models/jsonld/PhysicalExamInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'adverseOutcome' => ['MedicalEntity'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'contraindication' => ['Text', 'MedicalContraindication'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseSchedule' => ['DoseSchedule'], + 'drug' => ['Drug'], + 'duplicateTherapy' => ['MedicalTherapy'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'seriousAdverseOutcome' => ['MedicalEntity'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'contraindication', - 'duplicateTherapy', - 'seriousAdverseOutcome' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'contraindication' => ['MedicalContraindication', 'Text'], - 'duplicateTherapy' => ['MedicalTherapy'], - 'seriousAdverseOutcome' => ['MedicalEntity'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'contraindication' => 'A contraindication for this therapy.', - 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', - 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'contraindication' => 'A contraindication for this therapy.', + 'description' => 'A description of the item.', + '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.', + 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A contraindication for this therapy. - * - * @var mixed|MedicalContraindication|string [schema.org types: MedicalContraindication, Text] - */ - public $contraindication; - /** - * A therapy that duplicates or overlaps this one. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $duplicateTherapy; /** - * A possible serious complication and/or serious side effect of this therapy. - * Serious adverse outcomes include those that are life-threatening; result in - * death, disability, or permanent damage; require hospitalization or prolong - * existing hospitalization; cause congenital anomalies or birth defects; or - * jeopardize the patient and may require medical or surgical intervention to - * prevent one of the outcomes in this definition. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $seriousAdverseOutcome; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['contraindication', 'duplicateTherapy', 'seriousAdverseOutcome'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PhysicalTherapyInterface.php b/src/models/jsonld/PhysicalTherapyInterface.php new file mode 100644 index 000000000..74528bf69 --- /dev/null +++ b/src/models/jsonld/PhysicalTherapyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availableService' => ['MedicalTest', 'MedicalProcedure', 'MedicalTherapy'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthPlanNetworkId' => ['Text'], + 'hospitalAffiliation' => ['Hospital'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAcceptingNewPatients' => ['Boolean'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'medicalSpecialty' => ['MedicalSpecialty'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'availableService', - 'hospitalAffiliation', - 'medicalSpecialty' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'availableService' => ['MedicalProcedure', 'MedicalTest', 'MedicalTherapy'], - 'hospitalAffiliation' => ['Hospital'], - 'medicalSpecialty' => ['MedicalSpecialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'availableService' => 'A medical service available from this provider.', - 'hospitalAffiliation' => 'A hospital with which the physician or office is affiliated.', - 'medicalSpecialty' => 'A medical specialty of the provider.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availableService' => 'A medical service available from this provider.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + 'hospitalAffiliation' => 'A hospital with which the physician or office is affiliated.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'medicalSpecialty' => 'A medical specialty of the provider.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical service available from this provider. - * - * @var mixed|MedicalProcedure|MedicalTest|MedicalTherapy [schema.org types: MedicalProcedure, MedicalTest, MedicalTherapy] - */ - public $availableService; - /** - * A hospital with which the physician or office is affiliated. - * - * @var Hospital [schema.org types: Hospital] - */ - public $hospitalAffiliation; /** - * A medical specialty of the provider. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] + * @inheritdoc */ - public $medicalSpecialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['availableService', 'hospitalAffiliation', 'medicalSpecialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PhysicianInterface.php b/src/models/jsonld/PhysicianInterface.php new file mode 100644 index 000000000..77ee9ad71 --- /dev/null +++ b/src/models/jsonld/PhysicianInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PhysiotherapyInterface.php b/src/models/jsonld/PhysiotherapyInterface.php new file mode 100644 index 000000000..0ebbcf9db --- /dev/null +++ b/src/models/jsonld/PhysiotherapyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PlaceInterface.php b/src/models/jsonld/PlaceInterface.php new file mode 100644 index 000000000..aee5c564c --- /dev/null +++ b/src/models/jsonld/PlaceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PlaceOfWorshipInterface.php b/src/models/jsonld/PlaceOfWorshipInterface.php new file mode 100644 index 000000000..0eb24b550 --- /dev/null +++ b/src/models/jsonld/PlaceOfWorshipInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PlaceboControlledTrialInterface.php b/src/models/jsonld/PlaceboControlledTrialInterface.php new file mode 100644 index 000000000..06f6450fe --- /dev/null +++ b/src/models/jsonld/PlaceboControlledTrialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'scheduledTime' => ['DateTime'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'scheduledTime' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'scheduledTime' => 'The time the object is scheduled to.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'scheduledTime' => ['DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'scheduledTime' => 'The time the object is scheduled to.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The time the object is scheduled to. - * - * @var DateTime [schema.org types: DateTime] + * @inheritdoc */ - public $scheduledTime; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['scheduledTime'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PlanActionInterface.php b/src/models/jsonld/PlanActionInterface.php new file mode 100644 index 000000000..f67802d10 --- /dev/null +++ b/src/models/jsonld/PlanActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PlasticSurgeryInterface.php b/src/models/jsonld/PlasticSurgeryInterface.php new file mode 100644 index 000000000..f4ff42bdf --- /dev/null +++ b/src/models/jsonld/PlasticSurgeryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PlayAction.php b/src/models/jsonld/PlayAction.php index acc9e703f..0c3cc2093 100644 --- a/src/models/jsonld/PlayAction.php +++ b/src/models/jsonld/PlayAction.php @@ -1,33 +1,33 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'event' => ['Event'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'audience', - 'event' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'audience' => ['Audience'], - 'event' => ['Event'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $event; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['audience', 'event'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PlayActionInterface.php b/src/models/jsonld/PlayActionInterface.php new file mode 100644 index 000000000..262cdf75a --- /dev/null +++ b/src/models/jsonld/PlayActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'gameAvailabilityType' => ['GameAvailabilityEnumeration', 'Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + 'gameAvailabilityType' => 'Indicates the availability type of the game content associated with this action, such as whether it is a full version or a demo.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/PlayGameActionInterface.php b/src/models/jsonld/PlayGameActionInterface.php new file mode 100644 index 000000000..114f5f8ec --- /dev/null +++ b/src/models/jsonld/PlayGameActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PlaygroundInterface.php b/src/models/jsonld/PlaygroundInterface.php new file mode 100644 index 000000000..46877d499 --- /dev/null +++ b/src/models/jsonld/PlaygroundInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PlumberInterface.php b/src/models/jsonld/PlumberInterface.php new file mode 100644 index 000000000..371f35760 --- /dev/null +++ b/src/models/jsonld/PlumberInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'episodeNumber' => ['Integer', 'Text'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfSeason' => ['CreativeWorkSeason'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'director', - 'episodeNumber', - 'musicBy', - 'partOfSeason', - 'partOfSeries', - 'productionCompany', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'director' => ['Person'], - 'episodeNumber' => ['Integer', 'Text'], - 'musicBy' => ['MusicGroup', 'Person'], - 'partOfSeason' => ['CreativeWorkSeason'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'productionCompany' => ['Organization'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - '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. Supersedes directors.', - 'episodeNumber' => 'Position of the episode within an ordered group of episodes.', - 'musicBy' => 'The composer of the soundtrack.', - 'partOfSeason' => 'The season to which this episode belongs.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * Position of the episode within an ordered group of episodes. - * - * @var mixed|int|string [schema.org types: Integer, Text] + * @inheritdoc */ - public $episodeNumber; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'episodeNumber' => 'Position of the episode within an ordered group of episodes.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'partOfSeason' => 'The season to which this episode belongs.', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The season to which this episode belongs. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $partOfSeason; - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'director', 'episodeNumber', 'musicBy', 'partOfSeason', 'partOfSeries', 'productionCompany', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PodcastEpisodeInterface.php b/src/models/jsonld/PodcastEpisodeInterface.php new file mode 100644 index 000000000..b8fd73853 --- /dev/null +++ b/src/models/jsonld/PodcastEpisodeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'episode' => ['Episode'], + 'episodes' => ['Episode'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numberOfEpisodes' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'seasonNumber' => ['Text', 'Integer'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'director', - 'endDate', - 'episode', - 'numberOfEpisodes', - 'partOfSeries', - 'productionCompany', - 'seasonNumber', - 'startDate', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'director' => ['Person'], - 'endDate' => ['Date', 'DateTime'], - 'episode' => ['Episode'], - 'numberOfEpisodes' => ['Integer'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'productionCompany' => ['Organization'], - 'seasonNumber' => ['Integer', 'Text'], - 'startDate' => ['Date', 'DateTime'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - '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. Supersedes directors.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'episode' => 'An episode of a tv, radio or game media within a series or season. Supersedes episodes.', - 'numberOfEpisodes' => 'The number of episodes in this season or series.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'seasonNumber' => 'Position of the season within an ordered group of seasons.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * An episode of a tv, radio or game media within a series or season. - * Supersedes episodes. - * - * @var Episode [schema.org types: Episode] - */ - public $episode; - /** - * The number of episodes in this season or series. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $numberOfEpisodes; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'episode' => 'An episode of a tv, radio or game media within a series or season.', + 'episodes' => 'An episode of a TV/radio series or season.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numberOfEpisodes' => 'The number of episodes in this season or series.', + '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. ', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'seasonNumber' => 'Position of the season within an ordered group of seasons.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * Position of the season within an ordered group of seasons. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $seasonNumber; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'director', 'endDate', 'episode', 'numberOfEpisodes', 'partOfSeries', 'productionCompany', 'seasonNumber', 'startDate', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PodcastSeasonInterface.php b/src/models/jsonld/PodcastSeasonInterface.php new file mode 100644 index 000000000..dd8e1af91 --- /dev/null +++ b/src/models/jsonld/PodcastSeasonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'webFeed' => ['DataFeed', 'URL'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'webFeed' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'webFeed' => 'The URL for a feed, e.g. associated with a podcast series, blog, or series of date-stamped updates. This is usually RSS or Atom.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'webFeed' => ['DataFeed', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'webFeed' => 'The URL for a feed, e.g. associated with a podcast series, blog, or series of date-stamped updates. This is usually RSS or Atom.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The URL for a feed, e.g. associated with a podcast series, blog, or series - * of date-stamped updates. This is usually RSS or Atom. - * - * @var mixed|DataFeed|string [schema.org types: DataFeed, URL] + * @inheritdoc */ - public $webFeed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['webFeed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PodcastSeriesInterface.php b/src/models/jsonld/PodcastSeriesInterface.php new file mode 100644 index 000000000..6df10703f --- /dev/null +++ b/src/models/jsonld/PodcastSeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PodiatricInterface.php b/src/models/jsonld/PodiatricInterface.php new file mode 100644 index 000000000..222b32bdd --- /dev/null +++ b/src/models/jsonld/PodiatricInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PoliceStationInterface.php b/src/models/jsonld/PoliceStationInterface.php new file mode 100644 index 000000000..a085bec53 --- /dev/null +++ b/src/models/jsonld/PoliceStationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PondInterface.php b/src/models/jsonld/PondInterface.php new file mode 100644 index 000000000..bb547d6ae --- /dev/null +++ b/src/models/jsonld/PondInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PostOfficeInterface.php b/src/models/jsonld/PostOfficeInterface.php new file mode 100644 index 000000000..4cc9b8390 --- /dev/null +++ b/src/models/jsonld/PostOfficeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'addressCountry' => ['Country', 'Text'], + 'addressLocality' => ['Text'], + 'addressRegion' => ['Text'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'availableLanguage' => ['Text', 'Language'], + 'contactOption' => ['ContactPointOption'], + 'contactType' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'email' => ['Text'], + 'faxNumber' => ['Text'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'postOfficeBoxNumber' => ['Text'], + 'postalCode' => ['Text'], + 'potentialAction' => ['Action'], + 'productSupported' => ['Text', 'Product'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'streetAddress' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'addressCountry', - 'addressLocality', - 'addressRegion', - 'postOfficeBoxNumber', - 'postalCode', - 'streetAddress' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'addressCountry' => ['Country', 'Text'], - 'addressLocality' => ['Text'], - 'addressRegion' => ['Text'], - 'postOfficeBoxNumber' => ['Text'], - 'postalCode' => ['Text'], - 'streetAddress' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'addressCountry' => 'The country. For example, USA. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', - 'addressLocality' => 'The locality in which the street address is, and which is in the region. For example, Mountain View.', - 'addressRegion' => 'The region in which the locality is, and which is in the country. For example, California or another appropriate first-level Administrative division', - 'postOfficeBoxNumber' => 'The post office box number for PO box addresses.', - 'postalCode' => 'The postal code. For example, 94043.', - 'streetAddress' => 'The street address. For example, 1600 Amphitheatre Pkwy.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The country. For example, USA. You can also provide the two-letter ISO - * 3166-1 alpha-2 country code. - * - * @var mixed|Country|string [schema.org types: Country, Text] + * @inheritdoc */ - public $addressCountry; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + '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).', + 'addressLocality' => 'The locality in which the street address is, and which is in the region. For example, Mountain View.', + 'addressRegion' => 'The region in which the locality is, and which is in the country. For example, California or another appropriate first-level [Administrative division](https://en.wikipedia.org/wiki/List_of_administrative_divisions_by_country) ', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'contactOption' => 'An option available on this contact point (e.g. a toll-free number or support for hearing-impaired callers).', + 'contactType' => 'A person or organization can have different contact points, for different purposes. For example, a sales contact point, a PR contact point and so on. This property is used to specify the kind of contact point.', + 'description' => 'A description of the item.', + '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.', + 'email' => 'Email address.', + 'faxNumber' => 'The fax number.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'postOfficeBoxNumber' => 'The post office box number for PO box addresses.', + 'postalCode' => 'The postal code. For example, 94043.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productSupported' => 'The product or service this support contact point is related to (such as product support for a particular product line). This can be a specific product or product line (e.g. "iPhone") or a general category of products or services (e.g. "smartphones").', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'streetAddress' => 'The street address. For example, 1600 Amphitheatre Pkwy.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The locality in which the street address is, and which is in the region. - * For example, Mountain View. - * - * @var string [schema.org types: Text] - */ - public $addressLocality; /** - * The region in which the locality is, and which is in the country. For - * example, California or another appropriate first-level Administrative - * division - * - * @var string [schema.org types: Text] - */ - public $addressRegion; - /** - * The post office box number for PO box addresses. - * - * @var string [schema.org types: Text] - */ - public $postOfficeBoxNumber; - /** - * The postal code. For example, 94043. - * - * @var string [schema.org types: Text] - */ - public $postalCode; - /** - * The street address. For example, 1600 Amphitheatre Pkwy. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $streetAddress; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['addressCountry', 'addressLocality', 'addressRegion', 'postOfficeBoxNumber', 'postalCode', 'streetAddress'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PostalAddressInterface.php b/src/models/jsonld/PostalAddressInterface.php new file mode 100644 index 000000000..356a8fa44 --- /dev/null +++ b/src/models/jsonld/PostalAddressInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'postalCodeBegin' => ['Text'], + 'postalCodeEnd' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'postalCodeBegin' => 'First postal code in a range (included).', + 'postalCodeEnd' => 'Last postal code in the range (included). Needs to be after [[postalCodeBegin]].', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/PostalCodeRangeSpecificationInterface.php b/src/models/jsonld/PostalCodeRangeSpecificationInterface.php new file mode 100644 index 000000000..53ac600ed --- /dev/null +++ b/src/models/jsonld/PostalCodeRangeSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PosterInterface.php b/src/models/jsonld/PosterInterface.php new file mode 100644 index 000000000..aaa4ab338 --- /dev/null +++ b/src/models/jsonld/PosterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PotentialActionStatusInterface.php b/src/models/jsonld/PotentialActionStatusInterface.php new file mode 100644 index 000000000..f56acc783 --- /dev/null +++ b/src/models/jsonld/PotentialActionStatusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PreOrderAction.php b/src/models/jsonld/PreOrderAction.php index 30d2a9939..5ccebeb59 100644 --- a/src/models/jsonld/PreOrderAction.php +++ b/src/models/jsonld/PreOrderAction.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'price', - 'priceCurrency', - 'priceSpecification' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'price' => ['Number', 'Text'], - 'priceCurrency' => ['Text'], - 'priceSpecification' => ['PriceSpecification'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: Use the priceCurrency property (with standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR") instead of including ambiguous symbols such as \'$\' in the value. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The offer price of a product, or of a price component when attached to - * PriceSpecification and its subtypes. Usage guidelines: Use the - * priceCurrency property (with standard formats: ISO 4217 currency format - * e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names - * for Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR") instead of including ambiguous symbols such as '$' in the - * value. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a - * decimal point. Avoid using these symbols as a readability separator. Note - * that both RDFa and Microdata syntax allow the use of a "content=" attribute - * for publishing simple machine-readable values alongside more human-friendly - * formatting. Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to - * 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $price; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; /** - * One or more detailed price specifications, indicating the unit price and - * delivery or payment charges. - * - * @var PriceSpecification [schema.org types: PriceSpecification] + * @inheritdoc */ - public $priceSpecification; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['price', 'priceCurrency', 'priceSpecification'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PreOrderActionInterface.php b/src/models/jsonld/PreOrderActionInterface.php new file mode 100644 index 000000000..db2429805 --- /dev/null +++ b/src/models/jsonld/PreOrderActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PreSaleInterface.php b/src/models/jsonld/PreSaleInterface.php new file mode 100644 index 000000000..076b7b32c --- /dev/null +++ b/src/models/jsonld/PreSaleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/PregnancyHealthAspectInterface.php b/src/models/jsonld/PregnancyHealthAspectInterface.php new file mode 100644 index 000000000..2cc14a33c --- /dev/null +++ b/src/models/jsonld/PregnancyHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'collection' => ['Thing'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'targetCollection' => ['Thing'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'toLocation' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'collection' => 'A sub property of object. The collection target of the action.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'targetCollection' => 'A sub property of object. The collection target of the action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'toLocation' => ['Place'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PrependActionInterface.php b/src/models/jsonld/PrependActionInterface.php new file mode 100644 index 000000000..fa65a27f3 --- /dev/null +++ b/src/models/jsonld/PrependActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'alumni' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'alumni' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $alumni; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['alumni'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PreschoolInterface.php b/src/models/jsonld/PreschoolInterface.php new file mode 100644 index 000000000..6c9294294 --- /dev/null +++ b/src/models/jsonld/PreschoolInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PrescriptionOnlyInterface.php b/src/models/jsonld/PrescriptionOnlyInterface.php new file mode 100644 index 000000000..2e4e20f97 --- /dev/null +++ b/src/models/jsonld/PrescriptionOnlyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'hasDigitalDocumentPermission' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A permission related to the access to this document (e.g. permission to - * read or write an electronic document). For a public document, specify a - * grantee with an Audience with audienceType equal to "public". - * - * @var DigitalDocumentPermission [schema.org types: DigitalDocumentPermission] + * @inheritdoc */ - public $hasDigitalDocumentPermission; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasDigitalDocumentPermission'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PresentationDigitalDocumentInterface.php b/src/models/jsonld/PresentationDigitalDocumentInterface.php new file mode 100644 index 000000000..0f23acf37 --- /dev/null +++ b/src/models/jsonld/PresentationDigitalDocumentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PreventionHealthAspectInterface.php b/src/models/jsonld/PreventionHealthAspectInterface.php new file mode 100644 index 000000000..eefaa10a8 --- /dev/null +++ b/src/models/jsonld/PreventionHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'code', - 'guideline', - 'legalStatus', - 'medicineSystem', - 'recognizingAuthority', - 'relevantSpecialty', - 'study' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'code' => ['MedicalCode'], - 'guideline' => ['MedicalGuideline'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'medicineSystem' => ['MedicineSystem'], - 'recognizingAuthority' => ['Organization'], - 'relevantSpecialty' => ['MedicalSpecialty'], - 'study' => ['MedicalStudy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', - 'guideline' => 'A medical guideline related to this entity.', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', - 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', - 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', - 'study' => 'A medical study or trial related to this entity.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical code for the entity, taken from a controlled vocabulary or - * ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. - * - * @var MedicalCode [schema.org types: MedicalCode] - */ - public $code; - /** - * A medical guideline related to this entity. - * - * @var MedicalGuideline [schema.org types: MedicalGuideline] + * @inheritdoc */ - public $guideline; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The system of medicine that includes this MedicalEntity, for example - * 'evidence-based', 'homeopathic', 'chiropractic', etc. - * - * @var MedicineSystem [schema.org types: MedicineSystem] - */ - public $medicineSystem; - /** - * If applicable, the organization that officially recognizes this entity as - * part of its endorsed system of medicine. - * - * @var Organization [schema.org types: Organization] - */ - public $recognizingAuthority; - /** - * If applicable, a medical specialty in which this entity is relevant. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] - */ - public $relevantSpecialty; /** - * A medical study or trial related to this entity. - * - * @var MedicalStudy [schema.org types: MedicalStudy] + * @inheritdoc */ - public $study; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['code', 'guideline', 'legalStatus', 'medicineSystem', 'recognizingAuthority', 'relevantSpecialty', 'study'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PreventionIndicationInterface.php b/src/models/jsonld/PreventionIndicationInterface.php new file mode 100644 index 000000000..93bfe698a --- /dev/null +++ b/src/models/jsonld/PreventionIndicationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/PriceComponentTypeEnumerationInterface.php b/src/models/jsonld/PriceComponentTypeEnumerationInterface.php new file mode 100644 index 000000000..4bf0661d6 --- /dev/null +++ b/src/models/jsonld/PriceComponentTypeEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxPrice' => ['Number'], + 'minPrice' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'valueAddedTaxIncluded' => ['Boolean'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'eligibleQuantity', - 'eligibleTransactionVolume', - 'maxPrice', - 'minPrice', - 'price', - 'priceCurrency', - 'validFrom', - 'validThrough', - 'valueAddedTaxIncluded' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'eligibleQuantity' => ['QuantitativeValue'], - 'eligibleTransactionVolume' => ['PriceSpecification'], - 'maxPrice' => ['Number'], - 'minPrice' => ['Number'], - 'price' => ['Number', 'Text'], - 'priceCurrency' => ['Text'], - 'validFrom' => ['Date', 'DateTime'], - 'validThrough' => ['Date', 'DateTime'], - 'valueAddedTaxIncluded' => ['Boolean'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', - 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', - 'maxPrice' => 'The highest price if the price is a range.', - 'minPrice' => 'The lowest price if the price is a range.', - 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: Use the priceCurrency property (with standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR") instead of including ambiguous symbols such as \'$\' in the value. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'validFrom' => 'The date when the item becomes valid.', - 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', - 'valueAddedTaxIncluded' => 'Specifies whether the applicable value-added tax (VAT) is included in the price specification or not.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The interval and unit of measurement of ordering quantities for which the - * offer or price specification is valid. This allows e.g. specifying that a - * certain freight charge is valid only for a certain quantity. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $eligibleQuantity; - /** - * The transaction volume, in a monetary unit, for which the offer or price - * specification is valid, e.g. for indicating a minimal purchasing volume, to - * express free shipping above a certain order volume, or to limit the - * acceptance of credit cards to purchases to a certain minimal amount. - * - * @var PriceSpecification [schema.org types: PriceSpecification] - */ - public $eligibleTransactionVolume; - /** - * The highest price if the price is a range. - * - * @var float [schema.org types: Number] - */ - public $maxPrice; - /** - * The lowest price if the price is a range. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $minPrice; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maxPrice' => 'The highest price if the price is a range.', + 'minPrice' => 'The lowest price if the price is a range.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'valueAddedTaxIncluded' => 'Specifies whether the applicable value-added tax (VAT) is included in the price specification or not.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The offer price of a product, or of a price component when attached to - * PriceSpecification and its subtypes. Usage guidelines: Use the - * priceCurrency property (with standard formats: ISO 4217 currency format - * e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names - * for Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR") instead of including ambiguous symbols such as '$' in the - * value. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a - * decimal point. Avoid using these symbols as a readability separator. Note - * that both RDFa and Microdata syntax allow the use of a "content=" attribute - * for publishing simple machine-readable values alongside more human-friendly - * formatting. Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to - * 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $price; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; - /** - * The date when the item becomes valid. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validFrom; - /** - * The date after when the item is not valid. For example the end of an offer, - * salary period, or a period of opening hours. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $validThrough; - /** - * Specifies whether the applicable value-added tax (VAT) is included in the - * price specification or not. - * - * @var bool [schema.org types: Boolean] + * @inheritdoc */ - public $valueAddedTaxIncluded; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['eligibleQuantity', 'eligibleTransactionVolume', 'maxPrice', 'minPrice', 'price', 'priceCurrency', 'validFrom', 'validThrough', 'valueAddedTaxIncluded'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PriceSpecificationInterface.php b/src/models/jsonld/PriceSpecificationInterface.php new file mode 100644 index 000000000..6b9ad6f89 --- /dev/null +++ b/src/models/jsonld/PriceSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/PriceTypeEnumerationInterface.php b/src/models/jsonld/PriceTypeEnumerationInterface.php new file mode 100644 index 000000000..916aae1fa --- /dev/null +++ b/src/models/jsonld/PriceTypeEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PrimaryCareInterface.php b/src/models/jsonld/PrimaryCareInterface.php new file mode 100644 index 000000000..f25562dbb --- /dev/null +++ b/src/models/jsonld/PrimaryCareInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PrionInterface.php b/src/models/jsonld/PrionInterface.php new file mode 100644 index 000000000..7aaf82a21 --- /dev/null +++ b/src/models/jsonld/PrionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'model' => ['ProductModel', 'Text'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'potentialAction' => ['Action'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'weight' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'aggregateRating', - 'audience', - 'award', - 'brand', - 'category', - 'color', - 'depth', - 'gtin', - 'gtin12', - 'gtin13', - 'gtin14', - 'gtin8', - 'hasMerchantReturnPolicy', - 'height', - 'isAccessoryOrSparePartFor', - 'isConsumableFor', - 'isRelatedTo', - 'isSimilarTo', - 'itemCondition', - 'logo', - 'manufacturer', - 'material', - 'model', - 'mpn', - 'nsn', - 'offers', - 'productID', - 'productionDate', - 'purchaseDate', - 'releaseDate', - 'review', - 'sku', - 'slogan', - 'weight', - 'width' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'aggregateRating' => ['AggregateRating'], - 'audience' => ['Audience'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'color' => ['Text'], - 'depth' => ['Distance', 'QuantitativeValue'], - 'gtin' => ['Text'], - 'gtin12' => ['Text'], - 'gtin13' => ['Text'], - 'gtin14' => ['Text'], - 'gtin8' => ['Text'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'height' => ['Distance', 'QuantitativeValue'], - 'isAccessoryOrSparePartFor' => ['Product'], - 'isConsumableFor' => ['Product'], - 'isRelatedTo' => ['Product', 'Service'], - 'isSimilarTo' => ['Product', 'Service'], - 'itemCondition' => ['OfferItemCondition'], - 'logo' => ['ImageObject', 'URL'], - 'manufacturer' => ['Organization'], - 'material' => ['Product', 'Text', 'URL'], - 'model' => ['ProductModel', 'Text'], - 'mpn' => ['Text'], - 'nsn' => ['Text'], - 'offers' => ['Demand', 'Offer'], - 'productID' => ['Text'], - 'productionDate' => ['Date'], - 'purchaseDate' => ['Date'], - 'releaseDate' => ['Date'], - 'review' => ['Review'], - 'sku' => ['Text'], - 'slogan' => ['Text'], - 'weight' => ['QuantitativeValue'], - 'width' => ['Distance', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'color' => 'The color of the product.', - 'depth' => 'The depth of the item.', - 'gtin' => 'A Global Trade Item Number (GTIN). GTINs identify trade items, including products and services, using numeric identification codes. The gtin property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 properties. The GS1 digital link specifications express GTINs as URLs. A correct gtin value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a valid GS1 check digit and meet the other rules for valid GTINs. See also GS1\'s GTIN Summary and Wikipedia for more details. Left-padding of the gtin values is not required or encouraged.', - 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See GS1 GTIN Summary for more details.', - 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceeding zero. See GS1 GTIN Summary for more details.', - 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See GS1 GTIN Summary for more details.', - 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary for more details.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'height' => 'The height of the item.', - 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', - 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', - 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', - 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', - 'itemCondition' => 'A predefined value from OfferItemCondition or a textual description of the condition of the product or service, or the products or services included in the offer.', - 'logo' => 'An associated logo.', - 'manufacturer' => 'The manufacturer of the product.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', - 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', - 'nsn' => 'Indicates the NATO stock number (nsn) of a Product.', - '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. Inverse property: itemOffered.', - 'productID' => 'The product identifier, such as ISBN. For example: meta itemprop="productID" content="isbn:123-456-789".', - 'productionDate' => 'The date of production of the item, e.g. vehicle.', - 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', - 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', - 'review' => 'A review of the item. Supersedes reviews.', - 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', - 'slogan' => 'A slogan or motto associated with the item.', - 'weight' => 'The weight of the product or person.', - 'width' => 'The width of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * The color of the product. - * - * @var string [schema.org types: Text] - */ - public $color; - /** - * The depth of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] - */ - public $depth; - /** - * A Global Trade Item Number (GTIN). GTINs identify trade items, including - * products and services, using numeric identification codes. The gtin - * property generalizes the earlier gtin8, gtin12, gtin13, and gtin14 - * properties. The GS1 digital link specifications express GTINs as URLs. A - * correct gtin value should be a valid GTIN, which means that it should be an - * all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital - * Link" URL based on such a string. The numeric component should also have a - * valid GS1 check digit and meet the other rules for valid GTINs. See also - * GS1's GTIN Summary and Wikipedia for more details. Left-padding of the gtin - * values is not required or encouraged. - * - * @var string [schema.org types: Text] - */ - public $gtin; - /** - * The GTIN-12 code of the product, or the product to which the offer refers. - * The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. - * Company Prefix, Item Reference, and Check Digit used to identify trade - * items. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin12; - /** - * The GTIN-13 code of the product, or the product to which the offer refers. - * This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit - * UPC codes can be converted into a GTIN-13 code by simply adding a - * preceeding zero. See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin13; - /** - * The GTIN-14 code of the product, or the product to which the offer refers. - * See GS1 GTIN Summary for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin14; - /** - * The GTIN-8 code of the product, or the product to which the offer refers. - * This code is also known as EAN/UCC-8 or 8-digit EAN. See GS1 GTIN Summary - * for more details. - * - * @var string [schema.org types: Text] - */ - public $gtin8; /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * The height of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] - */ - public $height; - /** - * A pointer to another product (or multiple products) for which this product - * is an accessory or spare part. - * - * @var Product [schema.org types: Product] - */ - public $isAccessoryOrSparePartFor; - /** - * A pointer to another product (or multiple products) for which this product - * is a consumable. - * - * @var Product [schema.org types: Product] - */ - public $isConsumableFor; - /** - * A pointer to another, somehow related product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isRelatedTo; - /** - * A pointer to another, functionally similar product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isSimilarTo; - /** - * A predefined value from OfferItemCondition or a textual description of the - * condition of the product or service, or the products or services included - * in the offer. - * - * @var OfferItemCondition [schema.org types: OfferItemCondition] - */ - public $itemCondition; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The manufacturer of the product. - * - * @var Organization [schema.org types: Organization] - */ - public $manufacturer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The model of the product. Use with the URL of a ProductModel or a textual - * representation of the model identifier. The URL of the ProductModel can be - * from an external source. It is recommended to additionally provide strong - * product identifiers via the gtin8/gtin13/gtin14 and mpn properties. - * - * @var mixed|ProductModel|string [schema.org types: ProductModel, Text] - */ - public $model; - /** - * The Manufacturer Part Number (MPN) of the product, or the product to which - * the offer refers. - * - * @var string [schema.org types: Text] - */ - public $mpn; - /** - * Indicates the NATO stock number (nsn) of a Product. - * - * @var string [schema.org types: Text] - */ - public $nsn; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The product identifier, such as ISBN. For example: meta - * itemprop="productID" content="isbn:123-456-789". - * - * @var string [schema.org types: Text] - */ - public $productID; - /** - * The date of production of the item, e.g. vehicle. - * - * @var Date [schema.org types: Date] - */ - public $productionDate; - /** - * The date the item e.g. vehicle was purchased by the current owner. - * - * @var Date [schema.org types: Date] - */ - public $purchaseDate; - /** - * The release date of a product or product model. This can be used to - * distinguish the exact variant of a product. - * - * @var Date [schema.org types: Date] + * @inheritdoc */ - public $releaseDate; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'weight' => 'The weight of the product or person.', + 'width' => 'The width of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; /** - * The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a - * product or service, or the product to which the offer refers. - * - * @var string [schema.org types: Text] - */ - public $sku; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * The weight of the product or person. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $weight; - /** - * The width of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] + * @inheritdoc */ - public $width; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'aggregateRating', 'audience', 'award', 'brand', 'category', 'color', 'depth', 'gtin', 'gtin12', 'gtin13', 'gtin14', 'gtin8', 'hasMerchantReturnPolicy', 'height', 'isAccessoryOrSparePartFor', 'isConsumableFor', 'isRelatedTo', 'isSimilarTo', 'itemCondition', 'logo', 'manufacturer', 'material', 'model', 'mpn', 'nsn', 'offers', 'productID', 'productionDate', 'purchaseDate', 'releaseDate', 'review', 'sku', 'slogan', 'weight', 'width'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ProductCollection.php b/src/models/jsonld/ProductCollection.php new file mode 100644 index 000000000..8ca7641d8 --- /dev/null +++ b/src/models/jsonld/ProductCollection.php @@ -0,0 +1,451 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'collectionSize' => ['Integer'], + 'color' => ['Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'inProductGroupWithID' => ['Text'], + 'includesObject' => ['TypeAndQuantityNode'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'model' => ['ProductModel', 'Text'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'purchaseDate' => ['Date'], + 'recordedAt' => ['Event'], + 'releaseDate' => ['Date'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'weight' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'collectionSize' => 'The number of items in the [[Collection]].', + 'color' => 'The color of the product.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'includesObject' => 'This links to a node or nodes indicating the exact quantity of the products included in an [[Offer]] or [[ProductCollection]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'logo' => 'An associated logo.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'weight' => 'The weight of the product or person.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ProductCollectionInterface.php b/src/models/jsonld/ProductCollectionInterface.php new file mode 100644 index 000000000..88545c23d --- /dev/null +++ b/src/models/jsonld/ProductCollectionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasVariant' => ['Product'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'model' => ['ProductModel', 'Text'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'potentialAction' => ['Action'], + 'productGroupID' => ['Text'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'variesBy' => ['Text', 'DefinedTerm'], + 'weight' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasVariant' => 'Indicates a [[Product]] that is a member of this [[ProductGroup]] (or [[ProductModel]]).', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productGroupID' => 'Indicates a textual identifier for a ProductGroup.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'variesBy' => 'Indicates the property or properties by which the variants in a [[ProductGroup]] vary, e.g. their size, color etc. Schema.org properties can be referenced by their short name e.g. "color"; terms defined elsewhere can be referenced with their URIs.', + 'weight' => 'The weight of the product or person.', + 'width' => 'The width of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ProductGroupInterface.php b/src/models/jsonld/ProductGroupInterface.php new file mode 100644 index 000000000..e01449f44 --- /dev/null +++ b/src/models/jsonld/ProductGroupInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'model' => ['ProductModel', 'Text'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'potentialAction' => ['Action'], + 'predecessorOf' => ['ProductModel'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'successorOf' => ['ProductModel'], + 'url' => ['URL'], + 'weight' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'isVariantOf', - 'predecessorOf', - 'successorOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'isVariantOf' => ['ProductModel'], - 'predecessorOf' => ['ProductModel'], - 'successorOf' => ['ProductModel'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'isVariantOf' => 'A pointer to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive.', - 'predecessorOf' => 'A pointer from a previous, often discontinued variant of the product to its newer variant.', - 'successorOf' => 'A pointer from a newer variant of a product to its previous, often discontinued predecessor.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'predecessorOf' => 'A pointer from a previous, often discontinued variant of the product to its newer variant.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'successorOf' => 'A pointer from a newer variant of a product to its previous, often discontinued predecessor.', + 'url' => 'URL of the item.', + 'weight' => 'The weight of the product or person.', + 'width' => 'The width of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A pointer to a base product from which this product is a variant. It is - * safe to infer that the variant inherits all product features from the base - * model, unless defined locally. This is not transitive. - * - * @var ProductModel [schema.org types: ProductModel] - */ - public $isVariantOf; - /** - * A pointer from a previous, often discontinued variant of the product to its - * newer variant. - * - * @var ProductModel [schema.org types: ProductModel] - */ - public $predecessorOf; /** - * A pointer from a newer variant of a product to its previous, often - * discontinued predecessor. - * - * @var ProductModel [schema.org types: ProductModel] + * @inheritdoc */ - public $successorOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['isVariantOf', 'predecessorOf', 'successorOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ProductModelInterface.php b/src/models/jsonld/ProductModelInterface.php new file mode 100644 index 000000000..4b03e7c0c --- /dev/null +++ b/src/models/jsonld/ProductModelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ProfessionalServiceInterface.php b/src/models/jsonld/ProfessionalServiceInterface.php new file mode 100644 index 000000000..48757f7eb --- /dev/null +++ b/src/models/jsonld/ProfessionalServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ProfilePageInterface.php b/src/models/jsonld/ProfilePageInterface.php new file mode 100644 index 000000000..99e44526e --- /dev/null +++ b/src/models/jsonld/ProfilePageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PrognosisHealthAspectInterface.php b/src/models/jsonld/PrognosisHealthAspectInterface.php new file mode 100644 index 000000000..209f44bfe --- /dev/null +++ b/src/models/jsonld/PrognosisHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hostingOrganization' => ['Organization'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'member' => ['Organization', 'Person'], + 'members' => ['Person', 'Organization'], + 'membershipNumber' => ['Text'], + 'membershipPointsEarned' => ['Number', 'QuantitativeValue'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'programName' => ['Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'hostingOrganization', - 'member', - 'membershipNumber', - 'membershipPointsEarned', - 'programName' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hostingOrganization' => ['Organization'], - 'member' => ['Organization', 'Person'], - 'membershipNumber' => ['Text'], - 'membershipPointsEarned' => ['Number', 'QuantitativeValue'], - 'programName' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hostingOrganization' => 'The organization (airline, travelers\' club, etc.) the membership is made with.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'membershipNumber' => 'A unique identifier for the membership.', - 'membershipPointsEarned' => 'The number of membership points earned by the member. If necessary, the unitText can be used to express the units the points are issued in. (e.g. stars, miles, etc.)', - 'programName' => 'The program providing the membership.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'hostingOrganization' => 'The organization (airline, travelers\' club, etc.) the membership is made with.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'members' => 'A member of this organization.', + 'membershipNumber' => 'A unique identifier for the membership.', + 'membershipPointsEarned' => 'The number of membership points earned by the member. If necessary, the unitText can be used to express the units the points are issued in. (e.g. stars, miles, etc.)', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'programName' => 'The program providing the membership.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The organization (airline, travelers' club, etc.) the membership is made - * with. - * - * @var Organization [schema.org types: Organization] - */ - public $hostingOrganization; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * A unique identifier for the membership. - * - * @var string [schema.org types: Text] - */ - public $membershipNumber; - /** - * The number of membership points earned by the member. If necessary, the - * unitText can be used to express the units the points are issued in. (e.g. - * stars, miles, etc.) - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $membershipPointsEarned; - /** - * The program providing the membership. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $programName; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hostingOrganization', 'member', 'membershipNumber', 'membershipPointsEarned', 'programName'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ProgramMembershipInterface.php b/src/models/jsonld/ProgramMembershipInterface.php new file mode 100644 index 000000000..e626583ee --- /dev/null +++ b/src/models/jsonld/ProgramMembershipInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ProjectInterface.php b/src/models/jsonld/ProjectInterface.php new file mode 100644 index 000000000..452d7dd8a --- /dev/null +++ b/src/models/jsonld/ProjectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'inLanguage' => ['Text', 'Language'], + 'phoneticText' => ['Text'], + 'speechToTextMarkup' => ['Text'], + 'textValue' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'inLanguage', - 'phoneticText', - 'speechToTextMarkup', - 'textValue' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'inLanguage' => ['Language', 'Text'], - 'phoneticText' => ['Text'], - 'speechToTextMarkup' => ['Text'], - 'textValue' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. See also availableLanguage. Supersedes language.', - 'phoneticText' => 'Representation of a text textValue using the specified speechToTextMarkup. For example the city name of Houston in IPA: /ˈhjuːstən/.', - 'speechToTextMarkup' => 'Form of markup used. eg. SSML or IPA.', - 'textValue' => 'Text value being annotated.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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]].', + 'phoneticText' => 'Representation of a text [[textValue]] using the specified [[speechToTextMarkup]]. For example the city name of Houston in IPA: /ˈhjuːstən/.', + 'speechToTextMarkup' => 'Form of markup used. eg. [SSML](https://www.w3.org/TR/speech-synthesis11) or [IPA](https://www.wikidata.org/wiki/Property:P898).', + 'textValue' => 'Text value being annotated.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * Representation of a text textValue using the specified speechToTextMarkup. - * For example the city name of Houston in IPA: /ˈhjuːstən/. - * - * @var string [schema.org types: Text] - */ - public $phoneticText; - /** - * Form of markup used. eg. SSML or IPA. - * - * @var string [schema.org types: Text] - */ - public $speechToTextMarkup; /** - * Text value being annotated. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $textValue; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['inLanguage', 'phoneticText', 'speechToTextMarkup', 'textValue'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PronounceableTextInterface.php b/src/models/jsonld/PronounceableTextInterface.php new file mode 100644 index 000000000..57ad87493 --- /dev/null +++ b/src/models/jsonld/PronounceableTextInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'domainIncludes' => ['Class'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inverseOf' => ['Property'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'rangeIncludes' => ['Class'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'domainIncludes', - 'inverseOf', - 'rangeIncludes', - 'supersededBy' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'domainIncludes' => ['Class'], - 'inverseOf' => ['Property'], - 'rangeIncludes' => ['Class'], - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'domainIncludes' => 'Relates a property to a class that is (one of) the type(s) the property is expected to be used on.', - 'inverseOf' => 'Relates a property to a property that is its inverse. Inverse properties relate the same pairs of items to each other, but in reversed direction. For example, the \'alumni\' and \'alumniOf\' properties are inverseOf each other. Some properties don\'t have explicit inverses; in these situations RDFa and JSON-LD syntax for reverse properties can be used.', - 'rangeIncludes' => 'Relates a property to a class that constitutes (one of) the expected type(s) for values of the property.', - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'domainIncludes' => 'Relates a property to a class that is (one of) the type(s) the property is expected to be used on.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inverseOf' => 'Relates a property to a property that is its inverse. Inverse properties relate the same pairs of items to each other, but in reversed direction. For example, the \'alumni\' and \'alumniOf\' properties are inverseOf each other. Some properties don\'t have explicit inverses; in these situations RDFa and JSON-LD syntax for reverse properties can be used.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'rangeIncludes' => 'Relates a property to a class that constitutes (one of) the expected type(s) for values of the property.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a property to a class that is (one of) the type(s) the property is - * expected to be used on. - * - * @var Class [schema.org types: Class] - */ - public $domainIncludes; - /** - * Relates a property to a property that is its inverse. Inverse properties - * relate the same pairs of items to each other, but in reversed direction. - * For example, the 'alumni' and 'alumniOf' properties are inverseOf each - * other. Some properties don't have explicit inverses; in these situations - * RDFa and JSON-LD syntax for reverse properties can be used. - * - * @var Property [schema.org types: Property] - */ - public $inverseOf; - /** - * Relates a property to a class that constitutes (one of) the expected - * type(s) for values of the property. - * - * @var Class [schema.org types: Class] - */ - public $rangeIncludes; /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['domainIncludes', 'inverseOf', 'rangeIncludes', 'supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PropertyInterface.php b/src/models/jsonld/PropertyInterface.php new file mode 100644 index 000000000..25a868213 --- /dev/null +++ b/src/models/jsonld/PropertyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxValue' => ['Number'], + 'measurementTechnique' => ['Text', 'URL'], + 'minValue' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'propertyID' => ['Text', 'URL'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'unitCode' => ['Text', 'URL'], + 'unitText' => ['Text'], + 'url' => ['URL'], + 'value' => ['Text', 'Number', 'StructuredValue', 'Boolean'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'maxValue', - 'measurementTechnique', - 'minValue', - 'propertyID', - 'unitCode', - 'unitText', - 'value', - 'valueReference' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'maxValue' => ['Number'], - 'measurementTechnique' => ['Text', 'URL'], - 'minValue' => ['Number'], - 'propertyID' => ['Text', 'URL'], - 'unitCode' => ['Text', 'URL'], - 'unitText' => ['Text'], - 'value' => ['Boolean', 'Number', 'StructuredValue', 'Text'], - 'valueReference' => ['Enumeration', 'PropertyValue', 'QualitativeValue', 'QuantitativeValue', 'StructuredValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'maxValue' => 'The upper value of some characteristic or property.', - 'measurementTechnique' => 'A technique or technology used in a Dataset (or DataDownload, DataCatalog), corresponding to the method used for measuring the corresponding variable(s) (described using variableMeasured). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if variableMeasured is: molecule concentration, measurementTechnique could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the variableMeasured is "depression rating", the measurementTechnique could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several variableMeasured properties recorded for some given data object, use a PropertyValue for each variableMeasured and attach the corresponding measurementTechnique.', - 'minValue' => 'The lower value of some characteristic or property.', - 'propertyID' => 'A commonly used identifier for the characteristic represented by the property, e.g. a manufacturer or a standard code for a property. propertyID can be (1) a prefixed string, mainly meant to be used with standards for product properties; (2) a site-specific, non-prefixed string (e.g. the primary key of the property or the vendor-specific id of the property), or (3) a URL indicating the type of the property, either pointing to an external vocabulary, or a Web resource that describes the property (e.g. a glossary entry). Standards bodies should promote a standard prefix for the identifiers of properties from their standards.', - 'unitCode' => 'The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.', - 'unitText' => 'A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode.', - 'value' => 'The value of the quantitative value or property value node. For QuantitativeValue and MonetaryAmount, the recommended type for values is \'Number\'. For PropertyValue, it can be \'Text;\', \'Number\', \'Boolean\', or \'StructuredValue\'. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'valueReference' => 'A pointer to a secondary value that provides additional information on the original value, e.g. a reference temperature.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The upper value of some characteristic or property. - * - * @var float [schema.org types: Number] - */ - public $maxValue; - /** - * A technique or technology used in a Dataset (or DataDownload, DataCatalog), - * corresponding to the method used for measuring the corresponding - * variable(s) (described using variableMeasured). This is oriented towards - * scientific and scholarly dataset publication but may have broader - * applicability; it is not intended as a full representation of measurement, - * but rather as a high level summary for dataset discovery. For example, if - * variableMeasured is: molecule concentration, measurementTechnique could be: - * "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or - * "immunofluorescence". If the variableMeasured is "depression rating", the - * measurementTechnique could be "Zung Scale" or "HAM-D" or "Beck Depression - * Inventory". If there are several variableMeasured properties recorded for - * some given data object, use a PropertyValue for each variableMeasured and - * attach the corresponding measurementTechnique. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $measurementTechnique; - /** - * The lower value of some characteristic or property. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $minValue; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maxValue' => 'The upper value of some characteristic or property.', + 'measurementTechnique' => 'A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]), corresponding to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]]). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if [[variableMeasured]] is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the [[variableMeasured]] is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several [[variableMeasured]] properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]]. ', + 'minValue' => 'The lower value of some characteristic or property.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'propertyID' => 'A commonly used identifier for the characteristic represented by the property, e.g. a manufacturer or a standard code for a property. propertyID can be (1) a prefixed string, mainly meant to be used with standards for product properties; (2) a site-specific, non-prefixed string (e.g. the primary key of the property or the vendor-specific id of the property), or (3) a URL indicating the type of the property, either pointing to an external vocabulary, or a Web resource that describes the property (e.g. a glossary entry). Standards bodies should promote a standard prefix for the identifiers of properties from their standards.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'unitCode' => 'The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.', + 'unitText' => 'A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode.', + 'url' => 'URL of the item.', + 'value' => 'The value of the quantitative value or property value node. * For [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type for values is \'Number\'. * For [[PropertyValue]], it can be \'Text;\', \'Number\', \'Boolean\', or \'StructuredValue\'. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A commonly used identifier for the characteristic represented by the - * property, e.g. a manufacturer or a standard code for a property. propertyID - * can be (1) a prefixed string, mainly meant to be used with standards for - * product properties; (2) a site-specific, non-prefixed string (e.g. the - * primary key of the property or the vendor-specific id of the property), or - * (3) a URL indicating the type of the property, either pointing to an - * external vocabulary, or a Web resource that describes the property (e.g. a - * glossary entry). Standards bodies should promote a standard prefix for the - * identifiers of properties from their standards. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $propertyID; - /** - * The unit of measurement given using the UN/CEFACT Common Code (3 - * characters) or a URL. Other codes than the UN/CEFACT Common Code may be - * used with a prefix followed by a colon. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $unitCode; - /** - * A string or text indicating the unit of measurement. Useful if you cannot - * provide a standard unit code for unitCode. - * - * @var string [schema.org types: Text] - */ - public $unitText; /** - * The value of the quantitative value or property value node. For - * QuantitativeValue and MonetaryAmount, the recommended type for values is - * 'Number'. For PropertyValue, it can be 'Text;', 'Number', 'Boolean', or - * 'StructuredValue'. Use values from 0123456789 (Unicode 'DIGIT ZERO' - * (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar - * Unicode symbols. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to - * indicate a decimal point. Avoid using these symbols as a readability - * separator. - * - * @var mixed|bool|float|StructuredValue|string [schema.org types: Boolean, Number, StructuredValue, Text] - */ - public $value; - /** - * A pointer to a secondary value that provides additional information on the - * original value, e.g. a reference temperature. - * - * @var mixed|Enumeration|PropertyValue|QualitativeValue|QuantitativeValue|StructuredValue [schema.org types: Enumeration, PropertyValue, QualitativeValue, QuantitativeValue, StructuredValue] + * @inheritdoc */ - public $valueReference; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['maxValue', 'measurementTechnique', 'minValue', 'propertyID', 'unitCode', 'unitText', 'value', 'valueReference'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PropertyValueInterface.php b/src/models/jsonld/PropertyValueInterface.php new file mode 100644 index 000000000..b86c16f7a --- /dev/null +++ b/src/models/jsonld/PropertyValueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'defaultValue' => ['Text', 'Thing'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxValue' => ['Number'], + 'minValue' => ['Number'], + 'multipleValues' => ['Boolean'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'readonlyValue' => ['Boolean'], + 'sameAs' => ['URL'], + 'stepValue' => ['Number'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'valueMaxLength' => ['Number'], + 'valueMinLength' => ['Number'], + 'valueName' => ['Text'], + 'valuePattern' => ['Text'], + 'valueRequired' => ['Boolean'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'defaultValue', - 'maxValue', - 'minValue', - 'multipleValues', - 'readonlyValue', - 'stepValue', - 'valueMaxLength', - 'valueMinLength', - 'valueName', - 'valuePattern', - 'valueRequired' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'defaultValue' => ['Text', 'Thing'], - 'maxValue' => ['Number'], - 'minValue' => ['Number'], - 'multipleValues' => ['Boolean'], - 'readonlyValue' => ['Boolean'], - 'stepValue' => ['Number'], - 'valueMaxLength' => ['Number'], - 'valueMinLength' => ['Number'], - 'valueName' => ['Text'], - 'valuePattern' => ['Text'], - 'valueRequired' => ['Boolean'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'defaultValue' => 'The default value of the input. For properties that expect a literal, the default is a literal value, for properties that expect an object, it\'s an ID reference to one of the current values.', - 'maxValue' => 'The upper value of some characteristic or property.', - 'minValue' => 'The lower value of some characteristic or property.', - 'multipleValues' => 'Whether multiple values are allowed for the property. Default is false.', - 'readonlyValue' => 'Whether or not a property is mutable. Default is false. Specifying this for a property that also has a value makes it act similar to a "hidden" input in an HTML form.', - 'stepValue' => 'The stepValue attribute indicates the granularity that is expected (and required) of the value in a PropertyValueSpecification.', - 'valueMaxLength' => 'Specifies the allowed range for number of characters in a literal value.', - 'valueMinLength' => 'Specifies the minimum allowed range for number of characters in a literal value.', - 'valueName' => 'Indicates the name of the PropertyValueSpecification to be used in URL templates and form encoding in a manner analogous to HTML\'s input@name.', - 'valuePattern' => 'Specifies a regular expression for testing literal values according to the HTML spec.', - 'valueRequired' => 'Whether the property must be filled in to complete the action. Default is false.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The default value of the input. For properties that expect a literal, the - * default is a literal value, for properties that expect an object, it's an - * ID reference to one of the current values. - * - * @var mixed|string|Thing [schema.org types: Text, Thing] - */ - public $defaultValue; - /** - * The upper value of some characteristic or property. - * - * @var float [schema.org types: Number] - */ - public $maxValue; - /** - * The lower value of some characteristic or property. - * - * @var float [schema.org types: Number] - */ - public $minValue; - /** - * Whether multiple values are allowed for the property. Default is false. - * - * @var bool [schema.org types: Boolean] - */ - public $multipleValues; - /** - * Whether or not a property is mutable. Default is false. Specifying this for - * a property that also has a value makes it act similar to a "hidden" input - * in an HTML form. - * - * @var bool [schema.org types: Boolean] - */ - public $readonlyValue; - /** - * The stepValue attribute indicates the granularity that is expected (and - * required) of the value in a PropertyValueSpecification. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $stepValue; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'defaultValue' => 'The default value of the input. For properties that expect a literal, the default is a literal value, for properties that expect an object, it\'s an ID reference to one of the current values.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maxValue' => 'The upper value of some characteristic or property.', + 'minValue' => 'The lower value of some characteristic or property.', + 'multipleValues' => 'Whether multiple values are allowed for the property. Default is false.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'readonlyValue' => 'Whether or not a property is mutable. Default is false. Specifying this for a property that also has a value makes it act similar to a "hidden" input in an HTML form.', + '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.', + 'stepValue' => 'The stepValue attribute indicates the granularity that is expected (and required) of the value in a PropertyValueSpecification.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'valueMaxLength' => 'Specifies the allowed range for number of characters in a literal value.', + 'valueMinLength' => 'Specifies the minimum allowed range for number of characters in a literal value.', + 'valueName' => 'Indicates the name of the PropertyValueSpecification to be used in URL templates and form encoding in a manner analogous to HTML\'s input@name.', + 'valuePattern' => 'Specifies a regular expression for testing literal values according to the HTML spec.', + 'valueRequired' => 'Whether the property must be filled in to complete the action. Default is false.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Specifies the allowed range for number of characters in a literal value. - * - * @var float [schema.org types: Number] - */ - public $valueMaxLength; - /** - * Specifies the minimum allowed range for number of characters in a literal - * value. - * - * @var float [schema.org types: Number] - */ - public $valueMinLength; - /** - * Indicates the name of the PropertyValueSpecification to be used in URL - * templates and form encoding in a manner analogous to HTML's input@name. - * - * @var string [schema.org types: Text] - */ - public $valueName; - /** - * Specifies a regular expression for testing literal values according to the - * HTML spec. - * - * @var string [schema.org types: Text] - */ - public $valuePattern; /** - * Whether the property must be filled in to complete the action. Default is - * false. - * - * @var bool [schema.org types: Boolean] + * @inheritdoc */ - public $valueRequired; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['defaultValue', 'maxValue', 'minValue', 'multipleValues', 'readonlyValue', 'stepValue', 'valueMaxLength', 'valueMinLength', 'valueName', 'valuePattern', 'valueRequired'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PropertyValueSpecificationInterface.php b/src/models/jsonld/PropertyValueSpecificationInterface.php new file mode 100644 index 000000000..ab213db0a --- /dev/null +++ b/src/models/jsonld/PropertyValueSpecificationInterface.php @@ -0,0 +1,24 @@ +unitCode. + * + * @var string|Text + */ + public $unitText; + + /** + * A technique or technology used in a [[Dataset]] (or [[DataDownload]], + * [[DataCatalog]]), corresponding to the method used for measuring the + * corresponding variable(s) (described using [[variableMeasured]]). This is + * oriented towards scientific and scholarly dataset publication but may have + * broader applicability; it is not intended as a full representation of + * measurement, but rather as a high level summary for dataset discovery. For + * example, if [[variableMeasured]] is: molecule concentration, + * [[measurementTechnique]] could be: "mass spectrometry" or "nmr + * spectroscopy" or "colorimetry" or "immunofluorescence". If the + * [[variableMeasured]] is "depression rating", the [[measurementTechnique]] + * could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there + * are several [[variableMeasured]] properties recorded for some given data + * object, use a [[PropertyValue]] for each [[variableMeasured]] and attach + * the corresponding [[measurementTechnique]]. + * + * @var string|Text|URL + */ + public $measurementTechnique; + + /** + * The lower value of some characteristic or property. + * + * @var float|Number + */ + public $minValue; + + /** + * The value of the quantitative value or property value node. * For + * [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type for + * values is 'Number'. * For [[PropertyValue]], it can be 'Text;', 'Number', + * 'Boolean', or 'StructuredValue'. * Use values from 0123456789 (Unicode + * 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially + * similiar Unicode symbols. * Use '.' (Unicode 'FULL STOP' (U+002E)) rather + * than ',' to indicate a decimal point. Avoid using these symbols as a + * readability separator. + * + * @var string|float|bool|Text|Number|StructuredValue|Boolean + */ + public $value; + + /** + * The unit of measurement given using the UN/CEFACT Common Code (3 + * characters) or a URL. Other codes than the UN/CEFACT Common Code may be + * used with a prefix followed by a colon. + * + * @var string|Text|URL + */ + public $unitCode; + +} diff --git a/src/models/jsonld/Protein.php b/src/models/jsonld/Protein.php new file mode 100644 index 000000000..af2482bc1 --- /dev/null +++ b/src/models/jsonld/Protein.php @@ -0,0 +1,180 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedDisease' => ['URL', 'PropertyValue', 'MedicalCondition'], + 'bioChemInteraction' => ['BioChemEntity'], + 'bioChemSimilarity' => ['BioChemEntity'], + 'biologicalRole' => ['DefinedTerm'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'hasBioChemEntityPart' => ['BioChemEntity'], + 'hasBioPolymerSequence' => ['Text'], + 'hasMolecularFunction' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'hasRepresentation' => ['Text', 'PropertyValue', 'URL'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isEncodedByBioChemEntity' => ['Gene'], + 'isInvolvedInBiologicalProcess' => ['PropertyValue', 'URL', 'DefinedTerm'], + 'isLocatedInSubcellularLocation' => ['PropertyValue', 'DefinedTerm', 'URL'], + 'isPartOfBioChemEntity' => ['BioChemEntity'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxonomicRange' => ['URL', 'DefinedTerm', 'Text', 'Taxon'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + '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.', + 'bioChemInteraction' => 'A BioChemEntity that is known to interact with this item.', + 'bioChemSimilarity' => 'A similar BioChemEntity, e.g., obtained by fingerprint similarity algorithms.', + 'biologicalRole' => 'A role played by the BioChemEntity within a biological context.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'hasBioChemEntityPart' => 'Indicates a BioChemEntity that (in some sense) has this BioChemEntity as a part. ', + 'hasBioPolymerSequence' => 'A symbolic representation of a BioChemEnity. For example, a nucleotide sequence of a Gene or an amino acid sequence of a Protein.', + 'hasMolecularFunction' => 'Molecular function performed by this BioChemEntity; please use PropertyValue if you want to include any evidence.', + 'hasRepresentation' => 'A common representation such as a protein sequence or chemical structure for this entity. For images use schema.org/image.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isEncodedByBioChemEntity' => 'Another BioChemEntity encoding by this one.', + 'isInvolvedInBiologicalProcess' => 'Biological process this BioChemEntity is involved in; please use PropertyValue if you want to include any evidence.', + 'isLocatedInSubcellularLocation' => 'Subcellular location where this BioChemEntity is located; please use PropertyValue if you want to include any evidence.', + 'isPartOfBioChemEntity' => 'Indicates a BioChemEntity that is (in some sense) a part of this BioChemEntity. ', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxonomicRange' => 'The taxonomic grouping of the organism that expresses, encodes, or in someway related to the BioChemEntity.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ProteinInterface.php b/src/models/jsonld/ProteinInterface.php new file mode 100644 index 000000000..60d7ea0c4 --- /dev/null +++ b/src/models/jsonld/ProteinInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ProtozoaInterface.php b/src/models/jsonld/ProtozoaInterface.php new file mode 100644 index 000000000..625174049 --- /dev/null +++ b/src/models/jsonld/ProtozoaInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PsychiatricInterface.php b/src/models/jsonld/PsychiatricInterface.php new file mode 100644 index 000000000..bb9b88142 --- /dev/null +++ b/src/models/jsonld/PsychiatricInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'adverseOutcome' => ['MedicalEntity'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseSchedule' => ['DoseSchedule'], + 'drug' => ['Drug'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'adverseOutcome', - 'doseSchedule', - 'drug' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'adverseOutcome' => ['MedicalEntity'], - 'doseSchedule' => ['DoseSchedule'], - 'drug' => ['Drug'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', - 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', - 'drug' => 'Specifying a drug or medicine used in a medication procedure' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A possible complication and/or side effect of this therapy. If it is known - * that an adverse outcome is serious (resulting in death, disability, or - * permanent damage; requiring hospitalization; or is otherwise - * life-threatening or requires immediate medical attention), tag it as a - * seriouseAdverseOutcome instead. - * - * @var MedicalEntity [schema.org types: MedicalEntity] - */ - public $adverseOutcome; - /** - * A dosing schedule for the drug for a given population, either observed, - * recommended, or maximum dose based on the type used. - * - * @var DoseSchedule [schema.org types: DoseSchedule] - */ - public $doseSchedule; /** - * Specifying a drug or medicine used in a medication procedure - * - * @var Drug [schema.org types: Drug] + * @inheritdoc */ - public $drug; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['adverseOutcome', 'doseSchedule', 'drug'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PsychologicalTreatmentInterface.php b/src/models/jsonld/PsychologicalTreatmentInterface.php new file mode 100644 index 000000000..63338a972 --- /dev/null +++ b/src/models/jsonld/PsychologicalTreatmentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PublicHealthInterface.php b/src/models/jsonld/PublicHealthInterface.php new file mode 100644 index 000000000..88f1568d2 --- /dev/null +++ b/src/models/jsonld/PublicHealthInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PublicHolidaysInterface.php b/src/models/jsonld/PublicHolidaysInterface.php new file mode 100644 index 000000000..0e9984b05 --- /dev/null +++ b/src/models/jsonld/PublicHolidaysInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PublicSwimmingPoolInterface.php b/src/models/jsonld/PublicSwimmingPoolInterface.php new file mode 100644 index 000000000..e5ebf87d7 --- /dev/null +++ b/src/models/jsonld/PublicSwimmingPoolInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PublicToiletInterface.php b/src/models/jsonld/PublicToiletInterface.php new file mode 100644 index 000000000..aef29e74d --- /dev/null +++ b/src/models/jsonld/PublicToiletInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'free' => ['Boolean'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'publishedBy' => ['Organization', 'Person'], + 'publishedOn' => ['BroadcastService'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'isAccessibleForFree', - 'publishedBy', - 'publishedOn' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'isAccessibleForFree' => ['Boolean'], - 'publishedBy' => ['Organization', 'Person'], - 'publishedOn' => ['BroadcastService'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'publishedBy' => 'An agent associated with the publication event.', - 'publishedOn' => 'A broadcast service associated with the publication event.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'free' => 'A flag to signal that the item, event, or place is accessible for free.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'publishedBy' => 'An agent associated with the publication event.', + 'publishedOn' => 'A broadcast service associated with the publication event.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * An agent associated with the publication event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publishedBy; /** - * A broadcast service associated with the publication event. - * - * @var BroadcastService [schema.org types: BroadcastService] + * @inheritdoc */ - public $publishedOn; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['isAccessibleForFree', 'publishedBy', 'publishedOn'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PublicationEventInterface.php b/src/models/jsonld/PublicationEventInterface.php new file mode 100644 index 000000000..5fef6ceec --- /dev/null +++ b/src/models/jsonld/PublicationEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issueNumber' => ['Integer', 'Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'issueNumber', - 'pageEnd', - 'pageStart', - 'pagination' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'issueNumber' => ['Integer', 'Text'], - 'pageEnd' => ['Integer', 'Text'], - 'pageStart' => ['Integer', 'Text'], - 'pagination' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'issueNumber' => 'Identifies the issue of publication; for example, "iii" or "2".', - 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', - 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', - 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issueNumber' => 'Identifies the issue of publication; for example, "iii" or "2".', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Identifies the issue of publication; for example, "iii" or "2". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $issueNumber; - /** - * The page on which the work ends; for example "138" or "xvi". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageEnd; - /** - * The page on which the work starts; for example "135" or "xiii". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageStart; /** - * Any description of pages that is not separated into pageStart and pageEnd; - * for example, "1-6, 9, 55" or "10-12, 46-49". - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $pagination; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['issueNumber', 'pageEnd', 'pageStart', 'pagination'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PublicationIssueInterface.php b/src/models/jsonld/PublicationIssueInterface.php new file mode 100644 index 000000000..431472c4d --- /dev/null +++ b/src/models/jsonld/PublicationIssueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'volumeNumber' => ['Integer', 'Text'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'pageEnd', - 'pageStart', - 'pagination', - 'volumeNumber' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'pageEnd' => ['Integer', 'Text'], - 'pageStart' => ['Integer', 'Text'], - 'pagination' => ['Text'], - 'volumeNumber' => ['Integer', 'Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', - 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', - 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', - 'volumeNumber' => 'Identifies the volume of publication or multi-part work; for example, "iii" or "2".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'volumeNumber' => 'Identifies the volume of publication or multi-part work; for example, "iii" or "2".', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The page on which the work ends; for example "138" or "xvi". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageEnd; - /** - * The page on which the work starts; for example "135" or "xiii". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageStart; - /** - * Any description of pages that is not separated into pageStart and pageEnd; - * for example, "1-6, 9, 55" or "10-12, 46-49". - * - * @var string [schema.org types: Text] - */ - public $pagination; /** - * Identifies the volume of publication or multi-part work; for example, "iii" - * or "2". - * - * @var mixed|int|string [schema.org types: Integer, Text] + * @inheritdoc */ - public $volumeNumber; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['pageEnd', 'pageStart', 'pagination', 'volumeNumber'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PublicationVolumeInterface.php b/src/models/jsonld/PublicationVolumeInterface.php new file mode 100644 index 000000000..ad52e6e74 --- /dev/null +++ b/src/models/jsonld/PublicationVolumeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/PulmonaryInterface.php b/src/models/jsonld/PulmonaryInterface.php new file mode 100644 index 000000000..94382520a --- /dev/null +++ b/src/models/jsonld/PulmonaryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/QAPageInterface.php b/src/models/jsonld/QAPageInterface.php new file mode 100644 index 000000000..e8ce6cf58 --- /dev/null +++ b/src/models/jsonld/QAPageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'equal', - 'greater', - 'greaterOrEqual', - 'lesser', - 'lesserOrEqual', - 'nonEqual', - 'valueReference' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'equal' => ['QualitativeValue'], - 'greater' => ['QualitativeValue'], - 'greaterOrEqual' => ['QualitativeValue'], - 'lesser' => ['QualitativeValue'], - 'lesserOrEqual' => ['QualitativeValue'], - 'nonEqual' => ['QualitativeValue'], - 'valueReference' => ['Enumeration', 'PropertyValue', 'QualitativeValue', 'QuantitativeValue', 'StructuredValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', - 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', - 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', - 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', - 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', - 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', - 'valueReference' => 'A pointer to a secondary value that provides additional information on the original value, e.g. a reference temperature.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * This ordering relation for qualitative values indicates that the subject is - * equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $equal; - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] + * @inheritdoc */ - public $greater; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $greaterOrEqual; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesser; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesserOrEqual; /** - * This ordering relation for qualitative values indicates that the subject is - * not equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $nonEqual; - /** - * A pointer to a secondary value that provides additional information on the - * original value, e.g. a reference temperature. - * - * @var mixed|Enumeration|PropertyValue|QualitativeValue|QuantitativeValue|StructuredValue [schema.org types: Enumeration, PropertyValue, QualitativeValue, QuantitativeValue, StructuredValue] + * @inheritdoc */ - public $valueReference; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'equal', 'greater', 'greaterOrEqual', 'lesser', 'lesserOrEqual', 'nonEqual', 'valueReference'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/QualitativeValueInterface.php b/src/models/jsonld/QualitativeValueInterface.php new file mode 100644 index 000000000..4069c11cc --- /dev/null +++ b/src/models/jsonld/QualitativeValueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxValue' => ['Number'], + 'minValue' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'unitCode' => ['Text', 'URL'], + 'unitText' => ['Text'], + 'url' => ['URL'], + 'value' => ['Text', 'Number', 'StructuredValue', 'Boolean'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'maxValue', - 'minValue', - 'unitCode', - 'unitText', - 'value', - 'valueReference' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'maxValue' => ['Number'], - 'minValue' => ['Number'], - 'unitCode' => ['Text', 'URL'], - 'unitText' => ['Text'], - 'value' => ['Boolean', 'Number', 'StructuredValue', 'Text'], - 'valueReference' => ['Enumeration', 'PropertyValue', 'QualitativeValue', 'QuantitativeValue', 'StructuredValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'maxValue' => 'The upper value of some characteristic or property.', - 'minValue' => 'The lower value of some characteristic or property.', - 'unitCode' => 'The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.', - 'unitText' => 'A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode.', - 'value' => 'The value of the quantitative value or property value node. For QuantitativeValue and MonetaryAmount, the recommended type for values is \'Number\'. For PropertyValue, it can be \'Text;\', \'Number\', \'Boolean\', or \'StructuredValue\'. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'valueReference' => 'A pointer to a secondary value that provides additional information on the original value, e.g. a reference temperature.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * The upper value of some characteristic or property. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $maxValue; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maxValue' => 'The upper value of some characteristic or property.', + 'minValue' => 'The lower value of some characteristic or property.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'unitCode' => 'The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.', + 'unitText' => 'A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode.', + 'url' => 'URL of the item.', + 'value' => 'The value of the quantitative value or property value node. * For [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type for values is \'Number\'. * For [[PropertyValue]], it can be \'Text;\', \'Number\', \'Boolean\', or \'StructuredValue\'. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The lower value of some characteristic or property. - * - * @var float [schema.org types: Number] - */ - public $minValue; - /** - * The unit of measurement given using the UN/CEFACT Common Code (3 - * characters) or a URL. Other codes than the UN/CEFACT Common Code may be - * used with a prefix followed by a colon. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $unitCode; /** - * A string or text indicating the unit of measurement. Useful if you cannot - * provide a standard unit code for unitCode. - * - * @var string [schema.org types: Text] - */ - public $unitText; - /** - * The value of the quantitative value or property value node. For - * QuantitativeValue and MonetaryAmount, the recommended type for values is - * 'Number'. For PropertyValue, it can be 'Text;', 'Number', 'Boolean', or - * 'StructuredValue'. Use values from 0123456789 (Unicode 'DIGIT ZERO' - * (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar - * Unicode symbols. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to - * indicate a decimal point. Avoid using these symbols as a readability - * separator. - * - * @var mixed|bool|float|StructuredValue|string [schema.org types: Boolean, Number, StructuredValue, Text] - */ - public $value; - /** - * A pointer to a secondary value that provides additional information on the - * original value, e.g. a reference temperature. - * - * @var mixed|Enumeration|PropertyValue|QualitativeValue|QuantitativeValue|StructuredValue [schema.org types: Enumeration, PropertyValue, QualitativeValue, QuantitativeValue, StructuredValue] + * @inheritdoc */ - public $valueReference; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'maxValue', 'minValue', 'unitCode', 'unitText', 'value', 'valueReference'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/QuantitativeValueDistribution.php b/src/models/jsonld/QuantitativeValueDistribution.php index 8baa6f570..426771790 100644 --- a/src/models/jsonld/QuantitativeValueDistribution.php +++ b/src/models/jsonld/QuantitativeValueDistribution.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'duration' => ['Duration'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'median' => ['Number'], + 'name' => ['Text'], + 'percentile10' => ['Number'], + 'percentile25' => ['Number'], + 'percentile75' => ['Number'], + 'percentile90' => ['Number'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'duration', - 'median', - 'percentile10', - 'percentile25', - 'percentile75', - 'percentile90' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'duration' => ['Duration'], - 'median' => ['Number'], - 'percentile10' => ['Number'], - 'percentile25' => ['Number'], - 'percentile75' => ['Number'], - 'percentile90' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'median' => 'The median value.', - 'percentile10' => 'The 10th percentile value.', - 'percentile25' => 'The 25th percentile value.', - 'percentile75' => 'The 75th percentile value.', - 'percentile90' => 'The 90th percentile value.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] + * @inheritdoc */ - public $duration; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'median' => 'The median value.', + 'name' => 'The name of the item.', + 'percentile10' => 'The 10th percentile value.', + 'percentile25' => 'The 25th percentile value.', + 'percentile75' => 'The 75th percentile value.', + 'percentile90' => 'The 90th percentile value.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The median value. - * - * @var float [schema.org types: Number] - */ - public $median; /** - * The 10th percentile value. - * - * @var float [schema.org types: Number] - */ - public $percentile10; - /** - * The 25th percentile value. - * - * @var float [schema.org types: Number] - */ - public $percentile25; - /** - * The 75th percentile value. - * - * @var float [schema.org types: Number] - */ - public $percentile75; - /** - * The 90th percentile value. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $percentile90; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['duration', 'median', 'percentile10', 'percentile25', 'percentile75', 'percentile90'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/QuantitativeValueDistributionInterface.php b/src/models/jsonld/QuantitativeValueDistributionInterface.php new file mode 100644 index 000000000..0c1928ffb --- /dev/null +++ b/src/models/jsonld/QuantitativeValueDistributionInterface.php @@ -0,0 +1,24 @@ +unitCode. + * + * @var string|Text + */ + public $unitText; + + /** + * The lower value of some characteristic or property. + * + * @var float|Number + */ + public $minValue; + + /** + * The value of the quantitative value or property value node. * For + * [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type for + * values is 'Number'. * For [[PropertyValue]], it can be 'Text;', 'Number', + * 'Boolean', or 'StructuredValue'. * Use values from 0123456789 (Unicode + * 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially + * similiar Unicode symbols. * Use '.' (Unicode 'FULL STOP' (U+002E)) rather + * than ',' to indicate a decimal point. Avoid using these symbols as a + * readability separator. + * + * @var string|float|bool|Text|Number|StructuredValue|Boolean + */ + public $value; + + /** + * The unit of measurement given using the UN/CEFACT Common Code (3 + * characters) or a URL. Other codes than the UN/CEFACT Common Code may be + * used with a prefix followed by a colon. + * + * @var string|Text|URL + */ + public $unitCode; + + /** + * A property-value pair representing an additional characteristics of the + * entitity, e.g. a product feature or another characteristic for which there + * is no matching property in schema.org. Note: Publishers should be aware + * that applications designed to use specific schema.org properties (e.g. + * https://schema.org/width, https://schema.org/color, + * https://schema.org/gtin13, ...) will typically expect such data to be + * provided using those properties, rather than using the generic + * property/value mechanism. + * + * @var PropertyValue + */ + public $additionalProperty; + +} diff --git a/src/models/jsonld/Quantity.php b/src/models/jsonld/Quantity.php index 63883e531..d533f8f1f 100644 --- a/src/models/jsonld/Quantity.php +++ b/src/models/jsonld/Quantity.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/QuantityInterface.php b/src/models/jsonld/QuantityInterface.php new file mode 100644 index 000000000..f45f859a5 --- /dev/null +++ b/src/models/jsonld/QuantityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'acceptedAnswer' => ['Answer', 'ItemList'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'answerCount' => ['Integer'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'downvoteCount' => ['Integer'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'eduQuestionType' => ['Text'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'parentItem' => ['Comment'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'suggestedAnswer' => ['ItemList', 'Answer'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'upvoteCount' => ['Integer'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptedAnswer', - 'answerCount', - 'downvoteCount', - 'suggestedAnswer', - 'upvoteCount' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptedAnswer' => ['Answer', 'ItemList'], - 'answerCount' => ['Integer'], - 'downvoteCount' => ['Integer'], - 'suggestedAnswer' => ['Answer', 'ItemList'], - 'upvoteCount' => ['Integer'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptedAnswer' => 'The answer(s) that has been accepted as best, typically on a Question/Answer site. Sites vary in their selection mechanisms, e.g. drawing on community opinion and/or the view of the Question author.', - 'answerCount' => 'The number of answers this question has received.', - 'downvoteCount' => 'The number of downvotes this question, answer or comment has received from the community.', - 'suggestedAnswer' => 'An answer (possibly one of several, possibly incorrect) to a Question, e.g. on a Question/Answer site.', - 'upvoteCount' => 'The number of upvotes this question, answer or comment has received from the community.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'acceptedAnswer' => 'The answer(s) that has been accepted as best, typically on a Question/Answer site. Sites vary in their selection mechanisms, e.g. drawing on community opinion and/or the view of the Question author.', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'answerCount' => 'The number of answers this question has received.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'downvoteCount' => 'The number of downvotes this question, answer or comment has received from the community.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'eduQuestionType' => 'For questions that are part of learning resources (e.g. Quiz), eduQuestionType indicates the format of question being given. Example: "Multiple choice", "Open ended", "Flashcard".', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'parentItem' => 'The parent of a question, answer or item in general.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'suggestedAnswer' => 'An answer (possibly one of several, possibly incorrect) to a Question, e.g. on a Question/Answer site.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'upvoteCount' => 'The number of upvotes this question, answer or comment has received from the community.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The answer(s) that has been accepted as best, typically on a - * Question/Answer site. Sites vary in their selection mechanisms, e.g. - * drawing on community opinion and/or the view of the Question author. - * - * @var mixed|Answer|ItemList [schema.org types: Answer, ItemList] - */ - public $acceptedAnswer; - /** - * The number of answers this question has received. - * - * @var int [schema.org types: Integer] - */ - public $answerCount; - /** - * The number of downvotes this question, answer or comment has received from - * the community. - * - * @var int [schema.org types: Integer] - */ - public $downvoteCount; - /** - * An answer (possibly one of several, possibly incorrect) to a Question, e.g. - * on a Question/Answer site. - * - * @var mixed|Answer|ItemList [schema.org types: Answer, ItemList] - */ - public $suggestedAnswer; - /** - * The number of upvotes this question, answer or comment has received from - * the community. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $upvoteCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptedAnswer', 'answerCount', 'downvoteCount', 'suggestedAnswer', 'upvoteCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/QuestionInterface.php b/src/models/jsonld/QuestionInterface.php new file mode 100644 index 000000000..a4df648bd --- /dev/null +++ b/src/models/jsonld/QuestionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'competencyRequired' => ['Text', 'DefinedTerm', 'URL'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'competencyRequired' => 'Knowledge, skill, ability or personal attribute that must be demonstrated by a person or other entity in order to do something such as earn an Educational Occupational Credential or understand a LearningResource.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/QuizInterface.php b/src/models/jsonld/QuizInterface.php new file mode 100644 index 000000000..a857fb969 --- /dev/null +++ b/src/models/jsonld/QuizInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'spokenByCharacter' => ['Person', 'Organization'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'spokenByCharacter' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'spokenByCharacter' => 'The (e.g. fictional) character, Person or Organization to whom the quotation is attributed within the containing CreativeWork.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'spokenByCharacter' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'spokenByCharacter' => 'The (e.g. fictional) character, Person or Organization to whom the quotation is attributed within the containing CreativeWork.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The (e.g. fictional) character, Person or Organization to whom the - * quotation is attributed within the containing CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $spokenByCharacter; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['spokenByCharacter'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/QuotationInterface.php b/src/models/jsonld/QuotationInterface.php new file mode 100644 index 000000000..51288cf2b --- /dev/null +++ b/src/models/jsonld/QuotationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'price', - 'priceCurrency', - 'priceSpecification' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'price' => ['Number', 'Text'], - 'priceCurrency' => ['Text'], - 'priceSpecification' => ['PriceSpecification'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: Use the priceCurrency property (with standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR") instead of including ambiguous symbols such as \'$\' in the value. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The offer price of a product, or of a price component when attached to - * PriceSpecification and its subtypes. Usage guidelines: Use the - * priceCurrency property (with standard formats: ISO 4217 currency format - * e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names - * for Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR") instead of including ambiguous symbols such as '$' in the - * value. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a - * decimal point. Avoid using these symbols as a readability separator. Note - * that both RDFa and Microdata syntax allow the use of a "content=" attribute - * for publishing simple machine-readable values alongside more human-friendly - * formatting. Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to - * 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $price; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; /** - * One or more detailed price specifications, indicating the unit price and - * delivery or payment charges. - * - * @var PriceSpecification [schema.org types: PriceSpecification] + * @inheritdoc */ - public $priceSpecification; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['price', 'priceCurrency', 'priceSpecification'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/QuoteActionInterface.php b/src/models/jsonld/QuoteActionInterface.php new file mode 100644 index 000000000..794b49bc6 --- /dev/null +++ b/src/models/jsonld/QuoteActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RVParkInterface.php b/src/models/jsonld/RVParkInterface.php new file mode 100644 index 000000000..3102a1d30 --- /dev/null +++ b/src/models/jsonld/RVParkInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'adverseOutcome' => ['MedicalEntity'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'contraindication' => ['Text', 'MedicalContraindication'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseSchedule' => ['DoseSchedule'], + 'drug' => ['Drug'], + 'duplicateTherapy' => ['MedicalTherapy'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'seriousAdverseOutcome' => ['MedicalEntity'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'contraindication', - 'duplicateTherapy', - 'seriousAdverseOutcome' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'contraindication' => ['MedicalContraindication', 'Text'], - 'duplicateTherapy' => ['MedicalTherapy'], - 'seriousAdverseOutcome' => ['MedicalEntity'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'contraindication' => 'A contraindication for this therapy.', - 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', - 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'contraindication' => 'A contraindication for this therapy.', + 'description' => 'A description of the item.', + '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.', + 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A contraindication for this therapy. - * - * @var mixed|MedicalContraindication|string [schema.org types: MedicalContraindication, Text] - */ - public $contraindication; - /** - * A therapy that duplicates or overlaps this one. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $duplicateTherapy; /** - * A possible serious complication and/or serious side effect of this therapy. - * Serious adverse outcomes include those that are life-threatening; result in - * death, disability, or permanent damage; require hospitalization or prolong - * existing hospitalization; cause congenital anomalies or birth defects; or - * jeopardize the patient and may require medical or surgical intervention to - * prevent one of the outcomes in this definition. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $seriousAdverseOutcome; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['contraindication', 'duplicateTherapy', 'seriousAdverseOutcome'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RadiationTherapyInterface.php b/src/models/jsonld/RadiationTherapyInterface.php new file mode 100644 index 000000000..3ef13ff90 --- /dev/null +++ b/src/models/jsonld/RadiationTherapyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'area' => ['Place'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broadcastAffiliateOf' => ['Organization'], + 'broadcastDisplayName' => ['Text'], + 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], + 'broadcastTimezone' => ['Text'], + 'broadcaster' => ['Organization'], + 'broker' => ['Person', 'Organization'], + 'callSign' => ['Text'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hasBroadcastChannel' => ['BroadcastChannel'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'parentService' => ['BroadcastService'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'], + 'videoFormat' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'broadcastAffiliateOf', - 'broadcastDisplayName', - 'broadcastFrequency', - 'broadcastTimezone', - 'broadcaster', - 'callSign', - 'hasBroadcastChannel', - 'inLanguage', - 'parentService', - 'videoFormat' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'broadcastAffiliateOf' => ['Organization'], - 'broadcastDisplayName' => ['Text'], - 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], - 'broadcastTimezone' => ['Text'], - 'broadcaster' => ['Organization'], - 'callSign' => ['Text'], - 'hasBroadcastChannel' => ['BroadcastChannel'], - 'inLanguage' => ['Language', 'Text'], - 'parentService' => ['BroadcastService'], - 'videoFormat' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'broadcastAffiliateOf' => 'The media network(s) whose content is broadcast on this station.', - 'broadcastDisplayName' => 'The name displayed in the channel guide. For many US affiliates, it is the network name.', - 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', - 'broadcastTimezone' => 'The timezone in ISO 8601 format for which the service bases its broadcasts', - 'broadcaster' => 'The organization owning or operating the broadcast service.', - 'callSign' => 'A callsign, as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', - 'hasBroadcastChannel' => 'A broadcast channel of a broadcast service. Inverse property: providesBroadcastService.', - '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. See also availableLanguage. Supersedes language.', - 'parentService' => 'A broadcast service to which the broadcast service may belong to such as regional variations of a national channel.', - 'videoFormat' => 'The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The media network(s) whose content is broadcast on this station. - * - * @var Organization [schema.org types: Organization] - */ - public $broadcastAffiliateOf; - /** - * The name displayed in the channel guide. For many US affiliates, it is the - * network name. - * - * @var string [schema.org types: Text] - */ - public $broadcastDisplayName; - /** - * The frequency used for over-the-air broadcasts. Numeric values or simple - * ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences - * of AM and FM radio channels, e.g. "87 FM". - * - * @var mixed|BroadcastFrequencySpecification|string [schema.org types: BroadcastFrequencySpecification, Text] - */ - public $broadcastFrequency; - /** - * The timezone in ISO 8601 format for which the service bases its broadcasts - * - * @var string [schema.org types: Text] - */ - public $broadcastTimezone; - /** - * The organization owning or operating the broadcast service. - * - * @var Organization [schema.org types: Organization] + * @inheritdoc */ - public $broadcaster; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'area' => 'The area within which users can expect to reach the broadcast service.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'broadcastAffiliateOf' => 'The media network(s) whose content is broadcast on this station.', + 'broadcastDisplayName' => 'The name displayed in the channel guide. For many US affiliates, it is the network name.', + 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', + 'broadcastTimezone' => 'The timezone in [ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601) for which the service bases its broadcasts', + 'broadcaster' => 'The organization owning or operating the broadcast service.', + '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.', + 'callSign' => 'A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'hasBroadcastChannel' => 'A broadcast channel of a broadcast service.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'parentService' => 'A broadcast service to which the broadcast service may belong to such as regional variations of a national channel.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.', + 'videoFormat' => 'The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A callsign, as used in broadcasting and radio communications to identify - * people, radio and TV stations, or vehicles. - * - * @var string [schema.org types: Text] - */ - public $callSign; /** - * A broadcast channel of a broadcast service. Inverse property: - * providesBroadcastService. - * - * @var BroadcastChannel [schema.org types: BroadcastChannel] - */ - public $hasBroadcastChannel; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A broadcast service to which the broadcast service may belong to such as - * regional variations of a national channel. - * - * @var BroadcastService [schema.org types: BroadcastService] - */ - public $parentService; - /** - * The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, - * etc.). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $videoFormat; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['broadcastAffiliateOf', 'broadcastDisplayName', 'broadcastFrequency', 'broadcastTimezone', 'broadcaster', 'callSign', 'hasBroadcastChannel', 'inLanguage', 'parentService', 'videoFormat'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RadioBroadcastServiceInterface.php b/src/models/jsonld/RadioBroadcastServiceInterface.php new file mode 100644 index 000000000..c3d9b4cd7 --- /dev/null +++ b/src/models/jsonld/RadioBroadcastServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'broadcastChannelId' => ['Text'], + 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], + 'broadcastServiceTier' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'genre' => ['URL', 'Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inBroadcastLineup' => ['CableOrSatelliteService'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'providesBroadcastService' => ['BroadcastService'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'broadcastChannelId', - 'broadcastFrequency', - 'broadcastServiceTier', - 'genre', - 'inBroadcastLineup', - 'providesBroadcastService' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'broadcastChannelId' => ['Text'], - 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], - 'broadcastServiceTier' => ['Text'], - 'genre' => ['Text', 'URL'], - 'inBroadcastLineup' => ['CableOrSatelliteService'], - 'providesBroadcastService' => ['BroadcastService'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', - 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', - 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', - 'providesBroadcastService' => 'The BroadcastService offered on this channel. Inverse property: hasBroadcastChannel.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The unique address by which the BroadcastService can be identified in a - * provider lineup. In US, this is typically a number. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $broadcastChannelId; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', + 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', + 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', + 'description' => 'A description of the item.', + '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.', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'providesBroadcastService' => 'The BroadcastService offered on this channel.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The frequency used for over-the-air broadcasts. Numeric values or simple - * ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences - * of AM and FM radio channels, e.g. "87 FM". - * - * @var mixed|BroadcastFrequencySpecification|string [schema.org types: BroadcastFrequencySpecification, Text] - */ - public $broadcastFrequency; /** - * The type of service required to have access to the channel (e.g. Standard - * or Premium). - * - * @var string [schema.org types: Text] - */ - public $broadcastServiceTier; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * The CableOrSatelliteService offering the channel. - * - * @var CableOrSatelliteService [schema.org types: CableOrSatelliteService] - */ - public $inBroadcastLineup; - /** - * The BroadcastService offered on this channel. Inverse property: - * hasBroadcastChannel. - * - * @var BroadcastService [schema.org types: BroadcastService] + * @inheritdoc */ - public $providesBroadcastService; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['broadcastChannelId', 'broadcastFrequency', 'broadcastServiceTier', 'genre', 'inBroadcastLineup', 'providesBroadcastService'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RadioChannelInterface.php b/src/models/jsonld/RadioChannelInterface.php new file mode 100644 index 000000000..9f8a5a792 --- /dev/null +++ b/src/models/jsonld/RadioChannelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'clipNumber' => ['Text', 'Integer'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endOffset' => ['Number', 'HyperTocEntry'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfEpisode' => ['Episode'], + 'partOfSeason' => ['CreativeWorkSeason'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startOffset' => ['Number', 'HyperTocEntry'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'clipNumber', - 'director', - 'endOffset', - 'musicBy', - 'partOfEpisode', - 'partOfSeason', - 'partOfSeries', - 'startOffset' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'clipNumber' => ['Integer', 'Text'], - 'director' => ['Person'], - 'endOffset' => ['Number'], - 'musicBy' => ['MusicGroup', 'Person'], - 'partOfEpisode' => ['Episode'], - 'partOfSeason' => ['CreativeWorkSeason'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'startOffset' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'clipNumber' => 'Position of the clip within an ordered group of clips.', - '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. Supersedes directors.', - 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', - 'musicBy' => 'The composer of the soundtrack.', - 'partOfEpisode' => 'The episode to which this clip belongs.', - 'partOfSeason' => 'The season to which this episode belongs.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * Position of the clip within an ordered group of clips. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $clipNumber; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The end time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $endOffset; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'clipNumber' => 'Position of the clip within an ordered group of clips.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'partOfEpisode' => 'The episode to which this clip belongs.', + 'partOfSeason' => 'The season to which this episode belongs.', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The episode to which this clip belongs. - * - * @var Episode [schema.org types: Episode] - */ - public $partOfEpisode; - /** - * The season to which this episode belongs. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $partOfSeason; - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; - /** - * The start time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $startOffset; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'clipNumber', 'director', 'endOffset', 'musicBy', 'partOfEpisode', 'partOfSeason', 'partOfSeries', 'startOffset'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RadioClipInterface.php b/src/models/jsonld/RadioClipInterface.php new file mode 100644 index 000000000..3200b9f12 --- /dev/null +++ b/src/models/jsonld/RadioClipInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'episodeNumber' => ['Integer', 'Text'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfSeason' => ['CreativeWorkSeason'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'director', - 'episodeNumber', - 'musicBy', - 'partOfSeason', - 'partOfSeries', - 'productionCompany', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'director' => ['Person'], - 'episodeNumber' => ['Integer', 'Text'], - 'musicBy' => ['MusicGroup', 'Person'], - 'partOfSeason' => ['CreativeWorkSeason'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'productionCompany' => ['Organization'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - '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. Supersedes directors.', - 'episodeNumber' => 'Position of the episode within an ordered group of episodes.', - 'musicBy' => 'The composer of the soundtrack.', - 'partOfSeason' => 'The season to which this episode belongs.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * Position of the episode within an ordered group of episodes. - * - * @var mixed|int|string [schema.org types: Integer, Text] + * @inheritdoc */ - public $episodeNumber; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'episodeNumber' => 'Position of the episode within an ordered group of episodes.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'partOfSeason' => 'The season to which this episode belongs.', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The season to which this episode belongs. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $partOfSeason; - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'director', 'episodeNumber', 'musicBy', 'partOfSeason', 'partOfSeries', 'productionCompany', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RadioEpisodeInterface.php b/src/models/jsonld/RadioEpisodeInterface.php new file mode 100644 index 000000000..42149f7c5 --- /dev/null +++ b/src/models/jsonld/RadioEpisodeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'episode' => ['Episode'], + 'episodes' => ['Episode'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numberOfEpisodes' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'seasonNumber' => ['Text', 'Integer'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'director', - 'endDate', - 'episode', - 'numberOfEpisodes', - 'partOfSeries', - 'productionCompany', - 'seasonNumber', - 'startDate', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'director' => ['Person'], - 'endDate' => ['Date', 'DateTime'], - 'episode' => ['Episode'], - 'numberOfEpisodes' => ['Integer'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'productionCompany' => ['Organization'], - 'seasonNumber' => ['Integer', 'Text'], - 'startDate' => ['Date', 'DateTime'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - '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. Supersedes directors.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'episode' => 'An episode of a tv, radio or game media within a series or season. Supersedes episodes.', - 'numberOfEpisodes' => 'The number of episodes in this season or series.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'seasonNumber' => 'Position of the season within an ordered group of seasons.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * An episode of a tv, radio or game media within a series or season. - * Supersedes episodes. - * - * @var Episode [schema.org types: Episode] - */ - public $episode; - /** - * The number of episodes in this season or series. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $numberOfEpisodes; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'episode' => 'An episode of a tv, radio or game media within a series or season.', + 'episodes' => 'An episode of a TV/radio series or season.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numberOfEpisodes' => 'The number of episodes in this season or series.', + '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. ', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'seasonNumber' => 'Position of the season within an ordered group of seasons.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * Position of the season within an ordered group of seasons. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $seasonNumber; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'director', 'endDate', 'episode', 'numberOfEpisodes', 'partOfSeries', 'productionCompany', 'seasonNumber', 'startDate', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RadioSeasonInterface.php b/src/models/jsonld/RadioSeasonInterface.php new file mode 100644 index 000000000..3527db949 --- /dev/null +++ b/src/models/jsonld/RadioSeasonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'containsSeason' => ['CreativeWorkSeason'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'episode' => ['Episode'], + 'episodes' => ['Episode'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'numberOfEpisodes' => ['Integer'], + 'numberOfSeasons' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'season' => ['URL', 'CreativeWorkSeason'], + 'seasons' => ['CreativeWorkSeason'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'containsSeason', - 'director', - 'episode', - 'musicBy', - 'numberOfEpisodes', - 'numberOfSeasons', - 'productionCompany', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'containsSeason' => ['CreativeWorkSeason'], - 'director' => ['Person'], - 'episode' => ['Episode'], - 'musicBy' => ['MusicGroup', 'Person'], - 'numberOfEpisodes' => ['Integer'], - 'numberOfSeasons' => ['Integer'], - 'productionCompany' => ['Organization'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'containsSeason' => 'A season that is part of the media series. Supersedes season.', - '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. Supersedes directors.', - 'episode' => 'An episode of a tv, radio or game media within a series or season. Supersedes episodes.', - 'musicBy' => 'The composer of the soundtrack.', - 'numberOfEpisodes' => 'The number of episodes in this season or series.', - 'numberOfSeasons' => 'The number of seasons in this series.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * A season that is part of the media series. Supersedes season. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $containsSeason; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * An episode of a tv, radio or game media within a series or season. - * Supersedes episodes. - * - * @var Episode [schema.org types: Episode] + * @inheritdoc */ - public $episode; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'containsSeason' => 'A season that is part of the media series.', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'episode' => 'An episode of a tv, radio or game media within a series or season.', + 'episodes' => 'An episode of a TV/radio series or season.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + 'numberOfEpisodes' => 'The number of episodes in this season or series.', + 'numberOfSeasons' => 'The number of seasons in this series.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'season' => 'A season in a media series.', + 'seasons' => 'A season in a media series.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The number of episodes in this season or series. - * - * @var int [schema.org types: Integer] - */ - public $numberOfEpisodes; - /** - * The number of seasons in this series. - * - * @var int [schema.org types: Integer] - */ - public $numberOfSeasons; - /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'containsSeason', 'director', 'episode', 'musicBy', 'numberOfEpisodes', 'numberOfSeasons', 'productionCompany', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RadioSeriesInterface.php b/src/models/jsonld/RadioSeriesInterface.php new file mode 100644 index 000000000..ef0c46de6 --- /dev/null +++ b/src/models/jsonld/RadioSeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RadioStationInterface.php b/src/models/jsonld/RadioStationInterface.php new file mode 100644 index 000000000..8e741519c --- /dev/null +++ b/src/models/jsonld/RadioStationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RadiographyInterface.php b/src/models/jsonld/RadiographyInterface.php new file mode 100644 index 000000000..61b50ffc6 --- /dev/null +++ b/src/models/jsonld/RadiographyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RandomizedTrialInterface.php b/src/models/jsonld/RandomizedTrialInterface.php new file mode 100644 index 000000000..fc65fc077 --- /dev/null +++ b/src/models/jsonld/RandomizedTrialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'author' => ['Person', 'Organization'], + 'bestRating' => ['Text', 'Number'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'ratingExplanation' => ['Text'], + 'ratingValue' => ['Number', 'Text'], + 'reviewAspect' => ['Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'worstRating' => ['Text', 'Number'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'author', - 'bestRating', - 'ratingExplanation', - 'ratingValue', - 'reviewAspect', - 'worstRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'author' => ['Organization', 'Person'], - 'bestRating' => ['Number', 'Text'], - 'ratingExplanation' => ['Text'], - 'ratingValue' => ['Number', 'Text'], - 'reviewAspect' => ['Text'], - 'worstRating' => ['Number', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'bestRating' => 'The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed.', - 'ratingExplanation' => 'A short explanation (e.g. one to two sentences) providing background context and other information that led to the conclusion expressed in the rating. This is particularly applicable to ratings associated with "fact check" markup using ClaimReview.', - 'ratingValue' => 'The rating for the content. Usage guidelines: Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', - 'worstRating' => 'The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $author; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'bestRating' => 'The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'ratingExplanation' => 'A short explanation (e.g. one to two sentences) providing background context and other information that led to the conclusion expressed in the rating. This is particularly applicable to ratings associated with "fact check" markup using [[ClaimReview]].', + 'ratingValue' => 'The rating for the content. Usage guidelines: * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'worstRating' => 'The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The highest value allowed in this rating system. If bestRating is omitted, - * 5 is assumed. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $bestRating; /** - * A short explanation (e.g. one to two sentences) providing background - * context and other information that led to the conclusion expressed in the - * rating. This is particularly applicable to ratings associated with "fact - * check" markup using ClaimReview. - * - * @var string [schema.org types: Text] - */ - public $ratingExplanation; - /** - * The rating for the content. Usage guidelines: Use values from 0123456789 - * (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than - * superficially similiar Unicode symbols. Use '.' (Unicode 'FULL STOP' - * (U+002E)) rather than ',' to indicate a decimal point. Avoid using these - * symbols as a readability separator. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $ratingValue; - /** - * This Review or Rating is relevant to this part or facet of the - * itemReviewed. - * - * @var string [schema.org types: Text] - */ - public $reviewAspect; - /** - * The lowest value allowed in this rating system. If worstRating is omitted, - * 1 is assumed. - * - * @var mixed|float|string [schema.org types: Number, Text] + * @inheritdoc */ - public $worstRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['author', 'bestRating', 'ratingExplanation', 'ratingValue', 'reviewAspect', 'worstRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RatingInterface.php b/src/models/jsonld/RatingInterface.php new file mode 100644 index 000000000..49300a9a9 --- /dev/null +++ b/src/models/jsonld/RatingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReactActionInterface.php b/src/models/jsonld/ReactActionInterface.php new file mode 100644 index 000000000..4056de6b7 --- /dev/null +++ b/src/models/jsonld/ReactActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReadActionInterface.php b/src/models/jsonld/ReadActionInterface.php new file mode 100644 index 000000000..5598f51a5 --- /dev/null +++ b/src/models/jsonld/ReadActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReadPermissionInterface.php b/src/models/jsonld/ReadPermissionInterface.php new file mode 100644 index 000000000..12d13bc14 --- /dev/null +++ b/src/models/jsonld/ReadPermissionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RealEstateAgentInterface.php b/src/models/jsonld/RealEstateAgentInterface.php new file mode 100644 index 000000000..91330f25a --- /dev/null +++ b/src/models/jsonld/RealEstateAgentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePosted' => ['Date', 'DateTime'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'datePosted', - 'leaseLength' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'datePosted' => ['Date', 'DateTime'], - 'leaseLength' => ['Duration', 'QuantitativeValue'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePosted' => 'Publication date of an online listing.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'datePosted' => 'Publication date of an online listing.', - 'leaseLength' => 'Length of the lease for some Accommodation, either particular to some Offer or in some cases intrinsic to the property.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Publication date of an online listing. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePosted; - /** - * Length of the lease for some Accommodation, either particular to some Offer - * or in some cases intrinsic to the property. - * - * @var mixed|Duration|QuantitativeValue [schema.org types: Duration, QuantitativeValue] + * @inheritdoc */ - public $leaseLength; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['datePosted', 'leaseLength'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RealEstateListingInterface.php b/src/models/jsonld/RealEstateListingInterface.php new file mode 100644 index 000000000..97a768e90 --- /dev/null +++ b/src/models/jsonld/RealEstateListingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RearWheelDriveConfigurationInterface.php b/src/models/jsonld/RearWheelDriveConfigurationInterface.php new file mode 100644 index 000000000..37de7e9a2 --- /dev/null +++ b/src/models/jsonld/RearWheelDriveConfigurationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'deliveryMethod' => ['DeliveryMethod'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'sender' => ['Person', 'Audience', 'Organization'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'deliveryMethod', - 'sender' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'deliveryMethod' => ['DeliveryMethod'], - 'sender' => ['Audience', 'Organization', 'Person'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'deliveryMethod' => 'A sub property of instrument. The method of delivery.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'sender' => 'A sub property of participant. The participant who is at the sending end of the action.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'deliveryMethod' => 'A sub property of instrument. The method of delivery.', - 'sender' => 'A sub property of participant. The participant who is at the sending end of the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of instrument. The method of delivery. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] - */ - public $deliveryMethod; - /** - * A sub property of participant. The participant who is at the sending end of - * the action. - * - * @var mixed|Audience|Organization|Person [schema.org types: Audience, Organization, Person] + * @inheritdoc */ - public $sender; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['deliveryMethod', 'sender'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReceiveActionInterface.php b/src/models/jsonld/ReceiveActionInterface.php new file mode 100644 index 000000000..b4f4d3aca --- /dev/null +++ b/src/models/jsonld/ReceiveActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'cookTime' => ['Duration'], + 'cookingMethod' => ['Text'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'estimatedCost' => ['Text', 'MonetaryAmount'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ingredients' => ['Text'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'nutrition' => ['NutritionInformation'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'performTime' => ['Duration'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'prepTime' => ['Duration'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recipeCategory' => ['Text'], + 'recipeCuisine' => ['Text'], + 'recipeIngredient' => ['Text'], + 'recipeInstructions' => ['Text', 'CreativeWork', 'ItemList'], + 'recipeYield' => ['Text', 'QuantitativeValue'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'step' => ['HowToStep', 'HowToSection', 'Text', 'CreativeWork'], + 'steps' => ['ItemList', 'CreativeWork', 'Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'suitableForDiet' => ['RestrictedDiet'], + 'supply' => ['HowToSupply', 'Text'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'tool' => ['HowToTool', 'Text'], + 'totalTime' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'yield' => ['Text', 'QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cookTime', - 'cookingMethod', - 'nutrition', - 'recipeCategory', - 'recipeCuisine', - 'recipeIngredient', - 'recipeInstructions', - 'recipeYield', - 'suitableForDiet' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'cookTime' => ['Duration'], - 'cookingMethod' => ['Text'], - 'nutrition' => ['NutritionInformation'], - 'recipeCategory' => ['Text'], - 'recipeCuisine' => ['Text'], - 'recipeIngredient' => ['Text'], - 'recipeInstructions' => ['CreativeWork', 'ItemList', 'Text'], - 'recipeYield' => ['QuantitativeValue', 'Text'], - 'suitableForDiet' => ['RestrictedDiet'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cookTime' => 'The time it takes to actually cook the dish, in ISO 8601 duration format.', - 'cookingMethod' => 'The method of cooking, such as Frying, Steaming, ...', - 'nutrition' => 'Nutrition information about the recipe or menu item.', - 'recipeCategory' => 'The category of the recipe—for example, appetizer, entree, etc.', - 'recipeCuisine' => 'The cuisine of the recipe (for example, French or Ethiopian).', - 'recipeIngredient' => 'A single ingredient used in the recipe, e.g. sugar, flour or garlic. Supersedes ingredients.', - 'recipeInstructions' => 'A step in making the recipe, in the form of a single item (document, video, etc.) or an ordered list with HowToStep and/or HowToSection items.', - 'recipeYield' => 'The quantity produced by the recipe (for example, number of people served, number of servings, etc).', - 'suitableForDiet' => 'Indicates a dietary restriction or guideline for which this recipe or menu item is suitable, e.g. diabetic, halal etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The time it takes to actually cook the dish, in ISO 8601 duration format. - * - * @var Duration [schema.org types: Duration] - */ - public $cookTime; - /** - * The method of cooking, such as Frying, Steaming, ... - * - * @var string [schema.org types: Text] - */ - public $cookingMethod; - /** - * Nutrition information about the recipe or menu item. - * - * @var NutritionInformation [schema.org types: NutritionInformation] - */ - public $nutrition; - /** - * The category of the recipe—for example, appetizer, entree, etc. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $recipeCategory; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'cookTime' => 'The time it takes to actually cook the dish, in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'cookingMethod' => 'The method of cooking, such as Frying, Steaming, ...', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'estimatedCost' => 'The estimated cost of the supply or supplies consumed when performing instructions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ingredients' => 'A single ingredient used in the recipe, e.g. sugar, flour or garlic.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'nutrition' => 'Nutrition information about the recipe or menu item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'performTime' => 'The length of time it takes to perform instructions or a direction (not including time to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'prepTime' => 'The length of time it takes to prepare the items to be used in instructions or a direction, in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recipeCategory' => 'The category of the recipe—for example, appetizer, entree, etc.', + 'recipeCuisine' => 'The cuisine of the recipe (for example, French or Ethiopian).', + 'recipeIngredient' => 'A single ingredient used in the recipe, e.g. sugar, flour or garlic.', + 'recipeInstructions' => 'A step in making the recipe, in the form of a single item (document, video, etc.) or an ordered list with HowToStep and/or HowToSection items.', + 'recipeYield' => 'The quantity produced by the recipe (for example, number of people served, number of servings, etc).', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'step' => 'A single step item (as HowToStep, text, document, video, etc.) or a HowToSection.', + 'steps' => 'A single step item (as HowToStep, text, document, video, etc.) or a HowToSection (originally misnamed \'steps\'; \'step\' is preferred).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'suitableForDiet' => 'Indicates a dietary restriction or guideline for which this recipe or menu item is suitable, e.g. diabetic, halal etc.', + 'supply' => 'A sub-property of instrument. A supply consumed when performing instructions or a direction.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'tool' => 'A sub property of instrument. An object used (but not consumed) when performing instructions or a direction.', + 'totalTime' => 'The total time required to perform instructions or a direction (including time to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'yield' => 'The quantity that results by performing instructions. For example, a paper airplane, 10 personalized candles.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The cuisine of the recipe (for example, French or Ethiopian). - * - * @var string [schema.org types: Text] - */ - public $recipeCuisine; - /** - * A single ingredient used in the recipe, e.g. sugar, flour or garlic. - * Supersedes ingredients. - * - * @var string [schema.org types: Text] - */ - public $recipeIngredient; - /** - * A step in making the recipe, in the form of a single item (document, video, - * etc.) or an ordered list with HowToStep and/or HowToSection items. - * - * @var mixed|CreativeWork|ItemList|string [schema.org types: CreativeWork, ItemList, Text] - */ - public $recipeInstructions; - /** - * The quantity produced by the recipe (for example, number of people served, - * number of servings, etc). - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $recipeYield; - /** - * Indicates a dietary restriction or guideline for which this recipe or menu - * item is suitable, e.g. diabetic, halal etc. - * - * @var RestrictedDiet [schema.org types: RestrictedDiet] + * @inheritdoc */ - public $suitableForDiet; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cookTime', 'cookingMethod', 'nutrition', 'recipeCategory', 'recipeCuisine', 'recipeIngredient', 'recipeInstructions', 'recipeYield', 'suitableForDiet'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RecipeInterface.php b/src/models/jsonld/RecipeInterface.php new file mode 100644 index 000000000..3bc2703bd --- /dev/null +++ b/src/models/jsonld/RecipeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedClaimReview' => ['Review'], + 'associatedMedia' => ['MediaObject'], + 'associatedMediaReview' => ['Review'], + 'associatedReview' => ['Review'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'itemReviewed' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'negativeNotes' => ['ListItem', 'Text', 'WebContent', 'ItemList'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'positiveNotes' => ['WebContent', 'Text', 'ListItem', 'ItemList'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewAspect' => ['Text'], + 'reviewBody' => ['Text'], + 'reviewRating' => ['Rating'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'category' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedClaimReview' => 'An associated [[ClaimReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'associatedMediaReview' => 'An associated [[MediaReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedReview' => 'An associated [[Review]].', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'negativeNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), negative considerations - either as unstructured text, or a list.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'positiveNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), positive considerations - either as unstructured text, or a list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewBody' => 'The actual body of the review.', + 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating``` applies to rating given by the review. The [[aggregateRating]] property applies to the review itself, as a creative work.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] + * @inheritdoc */ - public $category; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['category'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RecommendationInterface.php b/src/models/jsonld/RecommendationInterface.php new file mode 100644 index 000000000..5f1fac177 --- /dev/null +++ b/src/models/jsonld/RecommendationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseUnit' => ['Text'], + 'doseValue' => ['Number', 'QualitativeValue'], + 'frequency' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'targetPopulation' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'doseUnit', - 'doseValue', - 'frequency', - 'targetPopulation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'doseUnit' => ['Text'], - 'doseValue' => ['Number', 'QualitativeValue'], - 'frequency' => ['Text'], - 'targetPopulation' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'doseUnit' => 'The unit of the dose, e.g. \'mg\'.', - 'doseValue' => 'The value of the dose, e.g. 500.', - 'frequency' => 'How often the dose is taken, e.g. \'daily\'.', - 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'doseUnit' => 'The unit of the dose, e.g. \'mg\'.', + 'doseValue' => 'The value of the dose, e.g. 500.', + 'frequency' => 'How often the dose is taken, e.g. \'daily\'.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The unit of the dose, e.g. 'mg'. - * - * @var string [schema.org types: Text] - */ - public $doseUnit; - /** - * The value of the dose, e.g. 500. - * - * @var mixed|float|QualitativeValue [schema.org types: Number, QualitativeValue] - */ - public $doseValue; - /** - * How often the dose is taken, e.g. 'daily'. - * - * @var string [schema.org types: Text] - */ - public $frequency; /** - * Characteristics of the population for which this is intended, or which - * typically uses it, e.g. 'adults'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $targetPopulation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['doseUnit', 'doseValue', 'frequency', 'targetPopulation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RecommendedDoseScheduleInterface.php b/src/models/jsonld/RecommendedDoseScheduleInterface.php new file mode 100644 index 000000000..9dd92e4a7 --- /dev/null +++ b/src/models/jsonld/RecommendedDoseScheduleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RecruitingInterface.php b/src/models/jsonld/RecruitingInterface.php new file mode 100644 index 000000000..f7659a7b0 --- /dev/null +++ b/src/models/jsonld/RecruitingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RecyclingCenterInterface.php b/src/models/jsonld/RecyclingCenterInterface.php new file mode 100644 index 000000000..eb54eddea --- /dev/null +++ b/src/models/jsonld/RecyclingCenterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReducedRelevanceForChildrenConsiderationInterface.php b/src/models/jsonld/ReducedRelevanceForChildrenConsiderationInterface.php new file mode 100644 index 000000000..70efc89c1 --- /dev/null +++ b/src/models/jsonld/ReducedRelevanceForChildrenConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RefundTypeEnumerationInterface.php b/src/models/jsonld/RefundTypeEnumerationInterface.php new file mode 100644 index 000000000..27593b0a0 --- /dev/null +++ b/src/models/jsonld/RefundTypeEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RefurbishedConditionInterface.php b/src/models/jsonld/RefurbishedConditionInterface.php new file mode 100644 index 000000000..52cb3460d --- /dev/null +++ b/src/models/jsonld/RefurbishedConditionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'endTime', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'endTime' => ['DateTime', 'Time'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book. The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. The result - * produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; - /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'endTime', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RegisterActionInterface.php b/src/models/jsonld/RegisterActionInterface.php new file mode 100644 index 000000000..e6fd91d33 --- /dev/null +++ b/src/models/jsonld/RegisterActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RegistryInterface.php b/src/models/jsonld/RegistryInterface.php new file mode 100644 index 000000000..0dd6c77cd --- /dev/null +++ b/src/models/jsonld/RegistryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReimbursementCapInterface.php b/src/models/jsonld/ReimbursementCapInterface.php new file mode 100644 index 000000000..2d063e664 --- /dev/null +++ b/src/models/jsonld/ReimbursementCapInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RejectActionInterface.php b/src/models/jsonld/RejectActionInterface.php new file mode 100644 index 000000000..44d7da9c1 --- /dev/null +++ b/src/models/jsonld/RejectActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RelatedTopicsHealthAspectInterface.php b/src/models/jsonld/RelatedTopicsHealthAspectInterface.php new file mode 100644 index 000000000..972897c05 --- /dev/null +++ b/src/models/jsonld/RelatedTopicsHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RemixAlbumInterface.php b/src/models/jsonld/RemixAlbumInterface.php new file mode 100644 index 000000000..f05345397 --- /dev/null +++ b/src/models/jsonld/RemixAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RenalInterface.php b/src/models/jsonld/RenalInterface.php new file mode 100644 index 000000000..894ae249b --- /dev/null +++ b/src/models/jsonld/RenalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'landlord' => ['Person', 'Organization'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'realEstateAgent' => ['RealEstateAgent'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'landlord', - 'realEstateAgent' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'landlord' => ['Organization', 'Person'], - 'realEstateAgent' => ['RealEstateAgent'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'landlord' => 'A sub property of participant. The owner of the real estate property.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'realEstateAgent' => 'A sub property of participant. The real estate agent involved in the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'landlord' => 'A sub property of participant. The owner of the real estate property.', - 'realEstateAgent' => 'A sub property of participant. The real estate agent involved in the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The owner of the real estate property. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $landlord; - /** - * A sub property of participant. The real estate agent involved in the - * action. - * - * @var RealEstateAgent [schema.org types: RealEstateAgent] + * @inheritdoc */ - public $realEstateAgent; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['landlord', 'realEstateAgent'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RentActionInterface.php b/src/models/jsonld/RentActionInterface.php new file mode 100644 index 000000000..162b0e916 --- /dev/null +++ b/src/models/jsonld/RentActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dropoffLocation' => ['Place'], + 'dropoffTime' => ['DateTime'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'pickupLocation' => ['Place'], + 'pickupTime' => ['DateTime'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dropoffLocation', - 'dropoffTime', - 'pickupLocation', - 'pickupTime' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dropoffLocation' => ['Place'], - 'dropoffTime' => ['DateTime'], - 'pickupLocation' => ['Place'], - 'pickupTime' => ['DateTime'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dropoffLocation' => 'Where a rental car can be dropped off.', - 'dropoffTime' => 'When a rental car can be dropped off.', - 'pickupLocation' => 'Where a taxi will pick up a passenger or a rental car can be picked up.', - 'pickupTime' => 'When a taxi will pickup a passenger or a rental car can be picked up.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + 'dropoffLocation' => 'Where a rental car can be dropped off.', + 'dropoffTime' => 'When a rental car can be dropped off.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'pickupLocation' => 'Where a taxi will pick up a passenger or a rental car can be picked up.', + 'pickupTime' => 'When a taxi will pickup a passenger or a rental car can be picked up.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Where a rental car can be dropped off. - * - * @var Place [schema.org types: Place] - */ - public $dropoffLocation; - /** - * When a rental car can be dropped off. - * - * @var DateTime [schema.org types: DateTime] - */ - public $dropoffTime; - /** - * Where a taxi will pick up a passenger or a rental car can be picked up. - * - * @var Place [schema.org types: Place] - */ - public $pickupLocation; /** - * When a taxi will pickup a passenger or a rental car can be picked up. - * - * @var DateTime [schema.org types: DateTime] + * @inheritdoc */ - public $pickupTime; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dropoffLocation', 'dropoffTime', 'pickupLocation', 'pickupTime'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RentalCarReservationInterface.php b/src/models/jsonld/RentalCarReservationInterface.php new file mode 100644 index 000000000..9a6c4299c --- /dev/null +++ b/src/models/jsonld/RentalCarReservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/RentalVehicleUsageInterface.php b/src/models/jsonld/RentalVehicleUsageInterface.php new file mode 100644 index 000000000..ecaa8b01e --- /dev/null +++ b/src/models/jsonld/RentalVehicleUsageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'downPayment' => ['Number', 'MonetaryAmount'], + 'earlyPrepaymentPenalty' => ['MonetaryAmount'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'loanPaymentAmount' => ['MonetaryAmount'], + 'loanPaymentFrequency' => ['Number'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'numberOfLoanPayments' => ['Number'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'downPayment', - 'earlyPrepaymentPenalty', - 'loanPaymentAmount', - 'loanPaymentFrequency', - 'numberOfLoanPayments' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'downPayment' => ['MonetaryAmount', 'Number'], - 'earlyPrepaymentPenalty' => ['MonetaryAmount'], - 'loanPaymentAmount' => ['MonetaryAmount'], - 'loanPaymentFrequency' => ['Number'], - 'numberOfLoanPayments' => ['Number'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'downPayment' => 'a type of payment made in cash during the onset of the purchase of an expensive good/service. The payment typically represents only a percentage of the full purchase price.', - 'earlyPrepaymentPenalty' => 'The amount to be paid as a penalty in the event of early payment of the loan.', - 'loanPaymentAmount' => 'The amount of money to pay in a single payment.', - 'loanPaymentFrequency' => 'Frequency of payments due, i.e. number of months between payments. This is defined as a frequency, i.e. the reciprocal of a period of time.', - 'numberOfLoanPayments' => 'The number of payments contractually required at origination to repay the loan. For monthly paying loans this is the number of months from the contractual first payment date to the maturity date.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'downPayment' => 'a type of payment made in cash during the onset of the purchase of an expensive good/service. The payment typically represents only a percentage of the full purchase price.', + 'earlyPrepaymentPenalty' => 'The amount to be paid as a penalty in the event of early payment of the loan.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'loanPaymentAmount' => 'The amount of money to pay in a single payment.', + 'loanPaymentFrequency' => 'Frequency of payments due, i.e. number of months between payments. This is defined as a frequency, i.e. the reciprocal of a period of time.', + '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.', + 'name' => 'The name of the item.', + 'numberOfLoanPayments' => 'The number of payments contractually required at origination to repay the loan. For monthly paying loans this is the number of months from the contractual first payment date to the maturity date.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * a type of payment made in cash during the onset of the purchase of an - * expensive good/service. The payment typically represents only a percentage - * of the full purchase price. - * - * @var mixed|MonetaryAmount|float [schema.org types: MonetaryAmount, Number] - */ - public $downPayment; - /** - * The amount to be paid as a penalty in the event of early payment of the - * loan. - * - * @var MonetaryAmount [schema.org types: MonetaryAmount] - */ - public $earlyPrepaymentPenalty; - /** - * The amount of money to pay in a single payment. - * - * @var MonetaryAmount [schema.org types: MonetaryAmount] - */ - public $loanPaymentAmount; - /** - * Frequency of payments due, i.e. number of months between payments. This is - * defined as a frequency, i.e. the reciprocal of a period of time. - * - * @var float [schema.org types: Number] - */ - public $loanPaymentFrequency; - /** - * The number of payments contractually required at origination to repay the - * loan. For monthly paying loans this is the number of months from the - * contractual first payment date to the maturity date. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $numberOfLoanPayments; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['downPayment', 'earlyPrepaymentPenalty', 'loanPaymentAmount', 'loanPaymentFrequency', 'numberOfLoanPayments'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RepaymentSpecificationInterface.php b/src/models/jsonld/RepaymentSpecificationInterface.php new file mode 100644 index 000000000..6695f5887 --- /dev/null +++ b/src/models/jsonld/RepaymentSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'collection' => ['Thing'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'replacee' => ['Thing'], + 'replacer' => ['Thing'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'targetCollection' => ['Thing'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'replacee', - 'replacer' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'replacee' => ['Thing'], - 'replacer' => ['Thing'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'collection' => 'A sub property of object. The collection target of the action.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'replacee' => 'A sub property of object. The object that is being replaced.', + 'replacer' => 'A sub property of object. The object that replaces.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'targetCollection' => 'A sub property of object. The collection target of the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'replacee' => 'A sub property of object. The object that is being replaced.', - 'replacer' => 'A sub property of object. The object that replaces.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of object. The object that is being replaced. - * - * @var Thing [schema.org types: Thing] - */ - public $replacee; - /** - * A sub property of object. The object that replaces. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $replacer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['replacee', 'replacer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReplaceActionInterface.php b/src/models/jsonld/ReplaceActionInterface.php new file mode 100644 index 000000000..8121e1b52 --- /dev/null +++ b/src/models/jsonld/ReplaceActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'resultComment' => ['Comment'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'resultComment' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + 'resultComment' => 'A sub property of result. The Comment created or sent as a result of this action.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'resultComment' => ['Comment'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'resultComment' => 'A sub property of result. The Comment created or sent as a result of this action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of result. The Comment created or sent as a result of this - * action. - * - * @var Comment [schema.org types: Comment] + * @inheritdoc */ - public $resultComment; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['resultComment'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReplyActionInterface.php b/src/models/jsonld/ReplyActionInterface.php new file mode 100644 index 000000000..e973b223e --- /dev/null +++ b/src/models/jsonld/ReplyActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'reportNumber' => ['Text'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'reportNumber' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'reportNumber' => 'The number or other unique designator assigned to a Report by the publishing organization.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'reportNumber' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'reportNumber' => 'The number or other unique designator assigned to a Report by the publishing organization.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number or other unique designator assigned to a Report by the - * publishing organization. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $reportNumber; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['reportNumber'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReportInterface.php b/src/models/jsonld/ReportInterface.php new file mode 100644 index 000000000..90bf3d0c3 --- /dev/null +++ b/src/models/jsonld/ReportInterface.php @@ -0,0 +1,24 @@ + ['Text'], - 'printColumn' => ['Text'], - 'printEdition' => ['Text'], - 'printPage' => ['Text'], - 'printSection' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dateline' => 'A dateline is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using locationCreated (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use contentLocation. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines".', - 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', - 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', - 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', - 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - // Static Protected Properties - // ========================================================================= /** - * A dateline is a brief piece of text included in news articles that - * describes where and when the story was written or filed though the date is - * often omitted. Sometimes only a placename is provided. Structured - * representations of dateline-related information can also be expressed more - * explicitly using locationCreated (which represents where a work was created - * e.g. where a news report was written). For location depicted or described - * in the content, use contentLocation. Dateline summaries are oriented more - * towards human readers than towards automated processing, and can vary - * substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", - * "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", - * "QUEZON CITY, Philippines". - * - * @var string [schema.org types: Text] - */ - public $dateline; - /** - * The number of the column in which the NewsArticle appears in the print - * edition. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $printColumn; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } + /** - * The edition of the print product in which the NewsArticle appears. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $printEdition; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dateline' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'printColumn' => ['Text'], + 'printEdition' => ['Text'], + 'printPage' => ['Text'], + 'printSection' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + /** - * If this NewsArticle appears in print, this field indicates the name of the - * page on which the article is found. Please note that this field is intended - * for the exact page name (e.g. A5, B18). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $printPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dateline' => 'A [dateline](https://en.wikipedia.org/wiki/Dateline) is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using [[locationCreated]] (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use [[contentLocation]]. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines". ', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', + 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', + 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', + 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + /** - * If this NewsArticle appears in print, this field indicates the print - * section in which the article appeared. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $printSection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dateline', 'printColumn', 'printEdition', 'printPage', 'printSection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReportageNewsArticleInterface.php b/src/models/jsonld/ReportageNewsArticleInterface.php new file mode 100644 index 000000000..84993872d --- /dev/null +++ b/src/models/jsonld/ReportageNewsArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseUnit' => ['Text'], + 'doseValue' => ['Number', 'QualitativeValue'], + 'frequency' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'targetPopulation' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'doseUnit', - 'doseValue', - 'frequency', - 'targetPopulation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'doseUnit' => ['Text'], - 'doseValue' => ['Number', 'QualitativeValue'], - 'frequency' => ['Text'], - 'targetPopulation' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'doseUnit' => 'The unit of the dose, e.g. \'mg\'.', - 'doseValue' => 'The value of the dose, e.g. 500.', - 'frequency' => 'How often the dose is taken, e.g. \'daily\'.', - 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'doseUnit' => 'The unit of the dose, e.g. \'mg\'.', + 'doseValue' => 'The value of the dose, e.g. 500.', + 'frequency' => 'How often the dose is taken, e.g. \'daily\'.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'targetPopulation' => 'Characteristics of the population for which this is intended, or which typically uses it, e.g. \'adults\'.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The unit of the dose, e.g. 'mg'. - * - * @var string [schema.org types: Text] - */ - public $doseUnit; - /** - * The value of the dose, e.g. 500. - * - * @var mixed|float|QualitativeValue [schema.org types: Number, QualitativeValue] - */ - public $doseValue; - /** - * How often the dose is taken, e.g. 'daily'. - * - * @var string [schema.org types: Text] - */ - public $frequency; /** - * Characteristics of the population for which this is intended, or which - * typically uses it, e.g. 'adults'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $targetPopulation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['doseUnit', 'doseValue', 'frequency', 'targetPopulation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReportedDoseScheduleInterface.php b/src/models/jsonld/ReportedDoseScheduleInterface.php new file mode 100644 index 000000000..3d7a66824 --- /dev/null +++ b/src/models/jsonld/ReportedDoseScheduleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ResearchOrganizationInterface.php b/src/models/jsonld/ResearchOrganizationInterface.php new file mode 100644 index 000000000..c249f15f9 --- /dev/null +++ b/src/models/jsonld/ResearchOrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person. Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place. The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions. Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard. Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand). A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain. The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number. The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. Points-of-Sales - * operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. The number of interactions for the CreativeWork using the - * WebSite or SoftwareApplication. The most specific child type of - * InteractionCounter should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. The International Standard of Industrial Classification - * of All Economic Activities (ISIC), Revision 4 code for a particular - * organization, business person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. Of a Person, and - * less typically of an Organization, to indicate a topic that is known about - * - suggesting possible expertise but not implying it. We do not distinguish - * skill levels here, or relate this to educational content, events, - * objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. Of a Person, and less typically of an Organization, to - * indicate a known language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). A pointer to products or services sought by the organization or - * person (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. The Tax / Fiscal ID of the organization or person, - * e.g. the TIN in the US or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ResearchProjectInterface.php b/src/models/jsonld/ResearchProjectInterface.php new file mode 100644 index 000000000..5be0584c5 --- /dev/null +++ b/src/models/jsonld/ResearchProjectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'audienceType' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'geographicArea' => ['AdministrativeArea'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'audienceType' => 'The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).', + 'description' => 'A description of the item.', + '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.', + 'geographicArea' => 'The geographic area associated with the audience.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ResearcherInterface.php b/src/models/jsonld/ResearcherInterface.php new file mode 100644 index 000000000..a1b7f492e --- /dev/null +++ b/src/models/jsonld/ResearcherInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bookingTime', - 'broker', - 'modifiedTime', - 'priceCurrency', - 'programMembershipUsed', - 'provider', - 'reservationFor', - 'reservationId', - 'reservationStatus', - 'reservedTicket', - 'totalPrice', - 'underName' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bookingTime' => ['DateTime'], - 'broker' => ['Organization', 'Person'], - 'modifiedTime' => ['DateTime'], - 'priceCurrency' => ['Text'], - 'programMembershipUsed' => ['ProgramMembership'], - 'provider' => ['Organization', 'Person'], - 'reservationFor' => ['Thing'], - 'reservationId' => ['Text'], - 'reservationStatus' => ['ReservationStatusType'], - 'reservedTicket' => ['Ticket'], - 'totalPrice' => ['Number', 'PriceSpecification', 'Text'], - 'underName' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bookingTime' => 'The date and time the reservation was booked.', - '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. Supersedes bookingAgent.', - 'modifiedTime' => 'The date and time the reservation was modified.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', - '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. Supersedes carrier.', - 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', - 'reservationId' => 'A unique identifier for the reservation.', - 'reservationStatus' => 'The current status of the reservation.', - 'reservedTicket' => 'A ticket associated with the reservation.', - '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 similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'underName' => 'The person or organization the reservation or ticket is for.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The date and time the reservation was booked. - * - * @var DateTime [schema.org types: DateTime] - */ - public $bookingTime; /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * The date and time the reservation was modified. - * - * @var DateTime [schema.org types: DateTime] - */ - public $modifiedTime; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; - /** - * Any membership in a frequent flyer, hotel loyalty program, etc. being - * applied to the reservation. - * - * @var ProgramMembership [schema.org types: ProgramMembership] - */ - public $programMembershipUsed; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * The thing -- flight, event, restaurant,etc. being reserved. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $reservationFor; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A unique identifier for the reservation. - * - * @var string [schema.org types: Text] - */ - public $reservationId; - /** - * The current status of the reservation. - * - * @var ReservationStatusType [schema.org types: ReservationStatusType] - */ - public $reservationStatus; - /** - * A ticket associated with the reservation. - * - * @var Ticket [schema.org types: Ticket] - */ - public $reservedTicket; - /** - * 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 similiar - * Unicode symbols. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to - * indicate a decimal point. Avoid using these symbols as a readability - * separator. - * - * @var mixed|float|PriceSpecification|string [schema.org types: Number, PriceSpecification, Text] - */ - public $totalPrice; /** - * The person or organization the reservation or ticket is for. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $underName; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bookingTime', 'broker', 'modifiedTime', 'priceCurrency', 'programMembershipUsed', 'provider', 'reservationFor', 'reservationId', 'reservationStatus', 'reservedTicket', 'totalPrice', 'underName'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReservationCancelled.php b/src/models/jsonld/ReservationCancelled.php index 0c56aa6b4..20726db49 100644 --- a/src/models/jsonld/ReservationCancelled.php +++ b/src/models/jsonld/ReservationCancelled.php @@ -1,28 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReservationCancelledInterface.php b/src/models/jsonld/ReservationCancelledInterface.php new file mode 100644 index 000000000..475feb44a --- /dev/null +++ b/src/models/jsonld/ReservationCancelledInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReservationConfirmedInterface.php b/src/models/jsonld/ReservationConfirmedInterface.php new file mode 100644 index 000000000..aa127bdfe --- /dev/null +++ b/src/models/jsonld/ReservationConfirmedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReservationHoldInterface.php b/src/models/jsonld/ReservationHoldInterface.php new file mode 100644 index 000000000..e409d1254 --- /dev/null +++ b/src/models/jsonld/ReservationHoldInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'subReservation' => ['Reservation'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'subReservation' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'subReservation' => 'The individual reservations included in the package. Typically a repeated property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'subReservation' => ['Reservation'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'subReservation' => 'The individual reservations included in the package. Typically a repeated property.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The individual reservations included in the package. Typically a repeated - * property. - * - * @var Reservation [schema.org types: Reservation] + * @inheritdoc */ - public $subReservation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['subReservation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReservationPackageInterface.php b/src/models/jsonld/ReservationPackageInterface.php new file mode 100644 index 000000000..63eab9f20 --- /dev/null +++ b/src/models/jsonld/ReservationPackageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReservationPendingInterface.php b/src/models/jsonld/ReservationPendingInterface.php new file mode 100644 index 000000000..47f79b662 --- /dev/null +++ b/src/models/jsonld/ReservationPendingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReservationStatusTypeInterface.php b/src/models/jsonld/ReservationStatusTypeInterface.php new file mode 100644 index 000000000..cee0f2dce --- /dev/null +++ b/src/models/jsonld/ReservationStatusTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'scheduledTime' => ['DateTime'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'scheduledTime' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'scheduledTime' => 'The time the object is scheduled to.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'scheduledTime' => ['DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'scheduledTime' => 'The time the object is scheduled to.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The time the object is scheduled to. - * - * @var DateTime [schema.org types: DateTime] + * @inheritdoc */ - public $scheduledTime; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['scheduledTime'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReserveActionInterface.php b/src/models/jsonld/ReserveActionInterface.php new file mode 100644 index 000000000..a050066c4 --- /dev/null +++ b/src/models/jsonld/ReserveActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReservoirInterface.php b/src/models/jsonld/ReservoirInterface.php new file mode 100644 index 000000000..eaac04fd2 --- /dev/null +++ b/src/models/jsonld/ReservoirInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'accommodationFloorPlan' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accommodationFloorPlan' => ['FloorPlan'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accommodationFloorPlan' => 'A floorplan of some Accommodation.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A floorplan of some Accommodation. - * - * @var FloorPlan [schema.org types: FloorPlan] + * @inheritdoc */ - public $accommodationFloorPlan; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accommodationFloorPlan'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ResidenceInterface.php b/src/models/jsonld/ResidenceInterface.php new file mode 100644 index 000000000..b358cd2cd --- /dev/null +++ b/src/models/jsonld/ResidenceInterface.php @@ -0,0 +1,24 @@ +http://en.wikipedia.org/wiki/Resort). + * See also the dedicated document on the use + * of schema.org for marking up hotels and other forms of accommodations. + * * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Resort + * @see https://schema.org/Resort */ -class Resort extends LodgingBusiness +class Resort extends MetaJsonLd implements ResortInterface, LodgingBusinessInterface, LocalBusinessInterface, OrganizationInterface, ThingInterface, PlaceInterface { // Static Public Properties // ========================================================================= @@ -36,235 +38,340 @@ class Resort extends LodgingBusiness * * @var string */ - static public $schemaTypeName = 'Resort'; + static public string $schemaTypeName = 'Resort'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Resort'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'A resort is a place used for relaxation or recreation, attracting visitors for holidays or vacations. Resorts are places, towns or sometimes commercial establishment operated by a single company (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Resort). See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/Resort'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'LodgingBusiness'; + static public string $schemaTypeExtends = 'LodgingBusiness'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<http://en.wikipedia.org/wiki/Resort). +

+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use ResortTrait; + use LodgingBusinessTrait; + use LocalBusinessTrait; + use OrganizationTrait; + use ThingTrait; + use PlaceTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableLanguage' => ['Text', 'Language'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'checkinTime' => ['DateTime', 'Time'], + 'checkoutTime' => ['DateTime', 'Time'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amenityFeature', - 'audience', - 'availableLanguage', - 'checkinTime', - 'checkoutTime', - 'numberOfRooms', - 'petsAllowed', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amenityFeature' => ['LocationFeatureSpecification'], - 'audience' => ['Audience'], - 'availableLanguage' => ['Language', 'Text'], - 'checkinTime' => ['DateTime', 'Time'], - 'checkoutTime' => ['DateTime', 'Time'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'petsAllowed' => ['Boolean', 'Text'], - 'starRating' => ['Rating'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. See also inLanguage', - 'checkinTime' => 'The earliest someone may check into a lodging establishment.', - 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A language someone may use with or at the item, service or place. Please - * use one of the language codes from the IETF BCP 47 standard. See also - * inLanguage - * - * @var mixed|Language|string [schema.org types: Language, Text] + * @inheritdoc */ - public $availableLanguage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'checkinTime' => 'The earliest someone may check into a lodging establishment.', + 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The earliest someone may check into a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkinTime; - /** - * The latest someone may check out of a lodging establishment. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $checkoutTime; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; - /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amenityFeature', 'audience', 'availableLanguage', 'checkinTime', 'checkoutTime', 'numberOfRooms', 'petsAllowed', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ResortInterface.php b/src/models/jsonld/ResortInterface.php new file mode 100644 index 000000000..8329094e7 --- /dev/null +++ b/src/models/jsonld/ResortInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'adverseOutcome' => ['MedicalEntity'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'contraindication' => ['Text', 'MedicalContraindication'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseSchedule' => ['DoseSchedule'], + 'drug' => ['Drug'], + 'duplicateTherapy' => ['MedicalTherapy'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'seriousAdverseOutcome' => ['MedicalEntity'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'contraindication', - 'duplicateTherapy', - 'seriousAdverseOutcome' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'contraindication' => ['MedicalContraindication', 'Text'], - 'duplicateTherapy' => ['MedicalTherapy'], - 'seriousAdverseOutcome' => ['MedicalEntity'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'contraindication' => 'A contraindication for this therapy.', - 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', - 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'contraindication' => 'A contraindication for this therapy.', + 'description' => 'A description of the item.', + '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.', + 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'duplicateTherapy' => 'A therapy that duplicates or overlaps this one.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'seriousAdverseOutcome' => 'A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A contraindication for this therapy. - * - * @var mixed|MedicalContraindication|string [schema.org types: MedicalContraindication, Text] - */ - public $contraindication; - /** - * A therapy that duplicates or overlaps this one. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $duplicateTherapy; - /** - * A possible serious complication and/or serious side effect of this therapy. - * Serious adverse outcomes include those that are life-threatening; result in - * death, disability, or permanent damage; require hospitalization or prolong - * existing hospitalization; cause congenital anomalies or birth defects; or - * jeopardize the patient and may require medical or surgical intervention to - * prevent one of the outcomes in this definition. - * - * @var MedicalEntity [schema.org types: MedicalEntity] + * @inheritdoc */ - public $seriousAdverseOutcome; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['contraindication', 'duplicateTherapy', 'seriousAdverseOutcome'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RespiratoryTherapyInterface.php b/src/models/jsonld/RespiratoryTherapyInterface.php new file mode 100644 index 000000000..113628fc9 --- /dev/null +++ b/src/models/jsonld/RespiratoryTherapyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RestaurantInterface.php b/src/models/jsonld/RestaurantInterface.php new file mode 100644 index 000000000..19d29fe64 --- /dev/null +++ b/src/models/jsonld/RestaurantInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RestockingFeesInterface.php b/src/models/jsonld/RestockingFeesInterface.php new file mode 100644 index 000000000..b2ccd7fdb --- /dev/null +++ b/src/models/jsonld/RestockingFeesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RestrictedDietInterface.php b/src/models/jsonld/RestrictedDietInterface.php new file mode 100644 index 000000000..38b386a64 --- /dev/null +++ b/src/models/jsonld/RestrictedDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ResultsAvailableInterface.php b/src/models/jsonld/ResultsAvailableInterface.php new file mode 100644 index 000000000..6a7e7a017 --- /dev/null +++ b/src/models/jsonld/ResultsAvailableInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ResultsNotAvailableInterface.php b/src/models/jsonld/ResultsNotAvailableInterface.php new file mode 100644 index 000000000..fc4db2402 --- /dev/null +++ b/src/models/jsonld/ResultsNotAvailableInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ResumeActionInterface.php b/src/models/jsonld/ResumeActionInterface.php new file mode 100644 index 000000000..31f1a31d3 --- /dev/null +++ b/src/models/jsonld/ResumeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RetailInterface.php b/src/models/jsonld/RetailInterface.php new file mode 100644 index 000000000..919be7e14 --- /dev/null +++ b/src/models/jsonld/RetailInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'recipient' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReturnActionInterface.php b/src/models/jsonld/ReturnActionInterface.php new file mode 100644 index 000000000..be06734f3 --- /dev/null +++ b/src/models/jsonld/ReturnActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReturnAtKioskInterface.php b/src/models/jsonld/ReturnAtKioskInterface.php new file mode 100644 index 000000000..1fb27229c --- /dev/null +++ b/src/models/jsonld/ReturnAtKioskInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReturnByMailInterface.php b/src/models/jsonld/ReturnByMailInterface.php new file mode 100644 index 000000000..c688785ae --- /dev/null +++ b/src/models/jsonld/ReturnByMailInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReturnFeesCustomerResponsibilityInterface.php b/src/models/jsonld/ReturnFeesCustomerResponsibilityInterface.php new file mode 100644 index 000000000..cc450c901 --- /dev/null +++ b/src/models/jsonld/ReturnFeesCustomerResponsibilityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReturnFeesEnumerationInterface.php b/src/models/jsonld/ReturnFeesEnumerationInterface.php new file mode 100644 index 000000000..1541413c4 --- /dev/null +++ b/src/models/jsonld/ReturnFeesEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReturnInStoreInterface.php b/src/models/jsonld/ReturnInStoreInterface.php new file mode 100644 index 000000000..d300b45b2 --- /dev/null +++ b/src/models/jsonld/ReturnInStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReturnLabelCustomerResponsibilityInterface.php b/src/models/jsonld/ReturnLabelCustomerResponsibilityInterface.php new file mode 100644 index 000000000..871f7301f --- /dev/null +++ b/src/models/jsonld/ReturnLabelCustomerResponsibilityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReturnLabelDownloadAndPrintInterface.php b/src/models/jsonld/ReturnLabelDownloadAndPrintInterface.php new file mode 100644 index 000000000..4bbd0708b --- /dev/null +++ b/src/models/jsonld/ReturnLabelDownloadAndPrintInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReturnLabelInBoxInterface.php b/src/models/jsonld/ReturnLabelInBoxInterface.php new file mode 100644 index 000000000..759906de3 --- /dev/null +++ b/src/models/jsonld/ReturnLabelInBoxInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReturnLabelSourceEnumerationInterface.php b/src/models/jsonld/ReturnLabelSourceEnumerationInterface.php new file mode 100644 index 000000000..9a58d98ab --- /dev/null +++ b/src/models/jsonld/ReturnLabelSourceEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ReturnMethodEnumerationInterface.php b/src/models/jsonld/ReturnMethodEnumerationInterface.php new file mode 100644 index 000000000..187a1153c --- /dev/null +++ b/src/models/jsonld/ReturnMethodEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReturnShippingFeesInterface.php b/src/models/jsonld/ReturnShippingFeesInterface.php new file mode 100644 index 000000000..978aca626 --- /dev/null +++ b/src/models/jsonld/ReturnShippingFeesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedClaimReview' => ['Review'], + 'associatedMedia' => ['MediaObject'], + 'associatedMediaReview' => ['Review'], + 'associatedReview' => ['Review'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'itemReviewed' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'negativeNotes' => ['ListItem', 'Text', 'WebContent', 'ItemList'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'positiveNotes' => ['WebContent', 'Text', 'ListItem', 'ItemList'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewAspect' => ['Text'], + 'reviewBody' => ['Text'], + 'reviewRating' => ['Rating'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemReviewed', - 'reviewAspect', - 'reviewBody', - 'reviewRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemReviewed' => ['Thing'], - 'reviewAspect' => ['Text'], - 'reviewBody' => ['Text'], - 'reviewRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'itemReviewed' => 'The item that is being reviewed/rated.', - 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', - 'reviewBody' => 'The actual body of the review.', - 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The reviewRating applies to rating given by the review. The aggregateRating property applies to the review itself, as a creative work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedClaimReview' => 'An associated [[ClaimReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'associatedMediaReview' => 'An associated [[MediaReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedReview' => 'An associated [[Review]].', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'negativeNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), negative considerations - either as unstructured text, or a list.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'positiveNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), positive considerations - either as unstructured text, or a list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewBody' => 'The actual body of the review.', + 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating``` applies to rating given by the review. The [[aggregateRating]] property applies to the review itself, as a creative work.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The item that is being reviewed/rated. - * - * @var Thing [schema.org types: Thing] - */ - public $itemReviewed; - /** - * This Review or Rating is relevant to this part or facet of the - * itemReviewed. - * - * @var string [schema.org types: Text] - */ - public $reviewAspect; - /** - * The actual body of the review. - * - * @var string [schema.org types: Text] - */ - public $reviewBody; /** - * The rating given in this review. Note that reviews can themselves be rated. - * The reviewRating applies to rating given by the review. The aggregateRating - * property applies to the review itself, as a creative work. - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $reviewRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemReviewed', 'reviewAspect', 'reviewBody', 'reviewRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReviewAction.php b/src/models/jsonld/ReviewAction.php index a7a9bcde9..6f82aa43f 100644 --- a/src/models/jsonld/ReviewAction.php +++ b/src/models/jsonld/ReviewAction.php @@ -1,29 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'resultReview' => ['Review'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'resultReview' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + 'resultReview' => 'A sub property of result. The review that resulted in the performing of the action.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'resultReview' => ['Review'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'resultReview' => 'A sub property of result. The review that resulted in the performing of the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of result. The review that resulted in the performing of the - * action. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $resultReview; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['resultReview'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReviewActionInterface.php b/src/models/jsonld/ReviewActionInterface.php new file mode 100644 index 000000000..080ce7b96 --- /dev/null +++ b/src/models/jsonld/ReviewActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedClaimReview' => ['Review'], + 'associatedMedia' => ['MediaObject'], + 'associatedMediaReview' => ['Review'], + 'associatedReview' => ['Review'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dateline' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'itemReviewed' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'negativeNotes' => ['ListItem', 'Text', 'WebContent', 'ItemList'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'positiveNotes' => ['WebContent', 'Text', 'ListItem', 'ItemList'], + 'potentialAction' => ['Action'], + 'printColumn' => ['Text'], + 'printEdition' => ['Text'], + 'printPage' => ['Text'], + 'printSection' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewAspect' => ['Text'], + 'reviewBody' => ['Text'], + 'reviewRating' => ['Rating'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemReviewed', - 'reviewAspect', - 'reviewBody', - 'reviewRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemReviewed' => ['Thing'], - 'reviewAspect' => ['Text'], - 'reviewBody' => ['Text'], - 'reviewRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'itemReviewed' => 'The item that is being reviewed/rated.', - 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', - 'reviewBody' => 'The actual body of the review.', - 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The reviewRating applies to rating given by the review. The aggregateRating property applies to the review itself, as a creative work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedClaimReview' => 'An associated [[ClaimReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'associatedMediaReview' => 'An associated [[MediaReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedReview' => 'An associated [[Review]].', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dateline' => 'A [dateline](https://en.wikipedia.org/wiki/Dateline) is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using [[locationCreated]] (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use [[contentLocation]]. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines". ', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'negativeNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), negative considerations - either as unstructured text, or a list.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'positiveNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), positive considerations - either as unstructured text, or a list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'printColumn' => 'The number of the column in which the NewsArticle appears in the print edition.', + 'printEdition' => 'The edition of the print product in which the NewsArticle appears.', + 'printPage' => 'If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18).', + 'printSection' => 'If this NewsArticle appears in print, this field indicates the print section in which the article appeared.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewBody' => 'The actual body of the review.', + 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating``` applies to rating given by the review. The [[aggregateRating]] property applies to the review itself, as a creative work.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The item that is being reviewed/rated. - * - * @var Thing [schema.org types: Thing] - */ - public $itemReviewed; - /** - * This Review or Rating is relevant to this part or facet of the - * itemReviewed. - * - * @var string [schema.org types: Text] - */ - public $reviewAspect; - /** - * The actual body of the review. - * - * @var string [schema.org types: Text] - */ - public $reviewBody; /** - * The rating given in this review. Note that reviews can themselves be rated. - * The reviewRating applies to rating given by the review. The aggregateRating - * property applies to the review itself, as a creative work. - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $reviewRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemReviewed', 'reviewAspect', 'reviewBody', 'reviewRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ReviewNewsArticleInterface.php b/src/models/jsonld/ReviewNewsArticleInterface.php new file mode 100644 index 000000000..cdbbe494a --- /dev/null +++ b/src/models/jsonld/ReviewNewsArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RheumatologicInterface.php b/src/models/jsonld/RheumatologicInterface.php new file mode 100644 index 000000000..b76b38223 --- /dev/null +++ b/src/models/jsonld/RheumatologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RightHandDrivingInterface.php b/src/models/jsonld/RightHandDrivingInterface.php new file mode 100644 index 000000000..0fcb3e92e --- /dev/null +++ b/src/models/jsonld/RightHandDrivingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RisksOrComplicationsHealthAspectInterface.php b/src/models/jsonld/RisksOrComplicationsHealthAspectInterface.php new file mode 100644 index 000000000..0b98af591 --- /dev/null +++ b/src/models/jsonld/RisksOrComplicationsHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place. The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number. The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. The International Standard of Industrial Classification - * of All Economic Activities (ISIC), Revision 4 code for a particular - * organization, business person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RiverBodyOfWaterInterface.php b/src/models/jsonld/RiverBodyOfWaterInterface.php new file mode 100644 index 000000000..ab9cfec64 --- /dev/null +++ b/src/models/jsonld/RiverBodyOfWaterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endDate' => ['Date', 'DateTime'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'namedPosition' => ['Text', 'URL'], + 'potentialAction' => ['Action'], + 'roleName' => ['URL', 'Text'], + 'sameAs' => ['URL'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'endDate', - 'roleName', - 'startDate' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'endDate' => ['Date', 'DateTime'], - 'roleName' => ['Text', 'URL'], - 'startDate' => ['Date', 'DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'roleName' => 'A role played, performed or filled by a person or organization. For example, the team of creators for a comic book might fill the roles named \'inker\', \'penciller\', and \'letterer\'; or an athlete in a SportsTeam might play in the position named \'Quarterback\'. Supersedes namedPosition.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'namedPosition' => 'A position played, performed or filled by a person or organization, as part of an organization. For example, an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'roleName' => 'A role played, performed or filled by a person or organization. For example, the team of creators for a comic book might fill the roles named \'inker\', \'penciller\', and \'letterer\'; or an athlete in a SportsTeam might play in the position named \'Quarterback\'.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * A role played, performed or filled by a person or organization. For - * example, the team of creators for a comic book might fill the roles named - * 'inker', 'penciller', and 'letterer'; or an athlete in a SportsTeam might - * play in the position named 'Quarterback'. Supersedes namedPosition. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $roleName; /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $startDate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['endDate', 'roleName', 'startDate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RoleInterface.php b/src/models/jsonld/RoleInterface.php new file mode 100644 index 000000000..61acd5907 --- /dev/null +++ b/src/models/jsonld/RoleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RoofingContractorInterface.php b/src/models/jsonld/RoofingContractorInterface.php new file mode 100644 index 000000000..d1590a9e3 --- /dev/null +++ b/src/models/jsonld/RoofingContractorInterface.php @@ -0,0 +1,24 @@ +http://en.wikipedia.org/wiki/Room). + * See also the dedicated document on the use + * of schema.org for marking up hotels and other forms of accommodations. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Room + * @see https://schema.org/Room */ -class Room extends Accommodation +class Room extends MetaJsonLd implements RoomInterface, AccommodationInterface, PlaceInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -35,308 +36,233 @@ class Room extends Accommodation * * @var string */ - static public $schemaTypeName = 'Room'; + static public string $schemaTypeName = 'Room'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Room'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'A room is a distinguishable space within a structure, usually separated from other spaces by interior walls. (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Room). See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/Room'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Accommodation'; + static public string $schemaTypeExtends = 'Accommodation'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<http://en.wikipedia.org/wiki/Room). +

+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use RoomTrait; + use AccommodationTrait; + use PlaceTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationCategory' => ['Text'], + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'floorLevel' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'permittedUsage' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'], + 'yearBuilt' => ['Number'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accommodationCategory', - 'accommodationFloorPlan', - 'amenityFeature', - 'floorLevel', - 'floorSize', - 'leaseLength', - 'numberOfBathroomsTotal', - 'numberOfBedrooms', - 'numberOfFullBathrooms', - 'numberOfPartialBathrooms', - 'numberOfRooms', - 'permittedUsage', - 'petsAllowed', - 'tourBookingPage', - 'yearBuilt' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accommodationCategory' => ['Text'], - 'accommodationFloorPlan' => ['FloorPlan'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'floorLevel' => ['Text'], - 'floorSize' => ['QuantitativeValue'], - 'leaseLength' => ['Duration', 'QuantitativeValue'], - 'numberOfBathroomsTotal' => ['Integer'], - 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], - 'numberOfFullBathrooms' => ['Number'], - 'numberOfPartialBathrooms' => ['Number'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'permittedUsage' => ['Text'], - 'petsAllowed' => ['Boolean', 'Text'], - 'tourBookingPage' => ['URL'], - 'yearBuilt' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accommodationCategory' => 'Category of an Accommodation, following real estate conventions e.g. RESO (see PropertySubType, and PropertyType fields for suggested values).', - 'accommodationFloorPlan' => 'A floorplan of some Accommodation.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'floorLevel' => 'The floor level for an Accommodation in a multi-storey building. Since counting systems vary internationally, the local system should be used where possible.', - 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard', - 'leaseLength' => 'Length of the lease for some Accommodation, either particular to some Offer or in some cases intrinsic to the property.', - 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some Accommodation, following real estate conventions as documented in RESO: "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also numberOfRooms.', - 'numberOfBedrooms' => 'The total integer number of bedrooms in a some Accommodation, ApartmentComplex or FloorPlan.', - 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an Accommodation. This corresponds to the BathroomsFull field in RESO.', - 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an Accommodation. This corresponds to the BathroomsPartial field in RESO.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', - 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.', - 'yearBuilt' => 'The year an Accommodation was constructed. This corresponds to the YearBuilt field in RESO.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Category of an Accommodation, following real estate conventions e.g. RESO - * (see PropertySubType, and PropertyType fields for suggested values). - * - * @var string [schema.org types: Text] - */ - public $accommodationCategory; - /** - * A floorplan of some Accommodation. - * - * @var FloorPlan [schema.org types: FloorPlan] - */ - public $accommodationFloorPlan; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * The floor level for an Accommodation in a multi-storey building. Since - * counting systems vary internationally, the local system should be used - * where possible. - * - * @var string [schema.org types: Text] - */ - public $floorLevel; - /** - * The size of the accommodation, e.g. in square meter or squarefoot. Typical - * unit code(s): MTK for square meter, FTK for square foot, or YDK for square - * yard - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $floorSize; - /** - * Length of the lease for some Accommodation, either particular to some Offer - * or in some cases intrinsic to the property. - * - * @var mixed|Duration|QuantitativeValue [schema.org types: Duration, QuantitativeValue] - */ - public $leaseLength; - /** - * The total integer number of bathrooms in a some Accommodation, following - * real estate conventions as documented in RESO: "The simple sum of the - * number of bathrooms. For example for a property with two Full Bathrooms and - * one Half Bathroom, the Bathrooms Total Integer will be 3.". See also - * numberOfRooms. - * - * @var int [schema.org types: Integer] - */ - public $numberOfBathroomsTotal; - /** - * The total integer number of bedrooms in a some Accommodation, - * ApartmentComplex or FloorPlan. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfBedrooms; - /** - * Number of full bathrooms - The total number of full and ¾ bathrooms in an - * Accommodation. This corresponds to the BathroomsFull field in RESO. - * - * @var float [schema.org types: Number] - */ - public $numberOfFullBathrooms; - /** - * Number of partial bathrooms - The total number of half and ¼ bathrooms in - * an Accommodation. This corresponds to the BathroomsPartial field in RESO. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $numberOfPartialBathrooms; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationCategory' => 'Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values).', + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'floorLevel' => 'The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.', + 'yearBuilt' => 'The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). ' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; - /** - * Indications regarding the permitted usage of the accommodation. - * - * @var string [schema.org types: Text] - */ - public $permittedUsage; - /** - * Indicates whether pets are allowed to enter the accommodation or lodging - * business. More detailed information can be put in a text value. - * - * @var mixed|bool|string [schema.org types: Boolean, Text] - */ - public $petsAllowed; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] - */ - public $tourBookingPage; - /** - * The year an Accommodation was constructed. This corresponds to the - * YearBuilt field in RESO. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $yearBuilt; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accommodationCategory', 'accommodationFloorPlan', 'amenityFeature', 'floorLevel', 'floorSize', 'leaseLength', 'numberOfBathroomsTotal', 'numberOfBedrooms', 'numberOfFullBathrooms', 'numberOfPartialBathrooms', 'numberOfRooms', 'permittedUsage', 'petsAllowed', 'tourBookingPage', 'yearBuilt'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RoomInterface.php b/src/models/jsonld/RoomInterface.php new file mode 100644 index 000000000..9bebad71a --- /dev/null +++ b/src/models/jsonld/RoomInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalNumberOfGuests' => ['Number'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'comment' => ['Comment'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'event' => ['Event'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'rsvpResponse' => ['RsvpResponseType'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalNumberOfGuests', - 'comment', - 'rsvpResponse' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalNumberOfGuests' => ['Number'], - 'comment' => ['Comment'], - 'rsvpResponse' => ['RsvpResponseType'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'additionalNumberOfGuests' => 'If responding yes, the number of guests who will attend in addition to the invitee.', - 'comment' => 'Comments, typically from users.', - 'rsvpResponse' => 'The response (yes, no, maybe) to the RSVP.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + 'additionalNumberOfGuests' => 'If responding yes, the number of guests who will attend in addition to the invitee.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'comment' => 'Comments, typically from users.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + 'rsvpResponse' => 'The response (yes, no, maybe) to the RSVP.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * If responding yes, the number of guests who will attend in addition to the - * invitee. - * - * @var float [schema.org types: Number] - */ - public $additionalNumberOfGuests; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; /** - * The response (yes, no, maybe) to the RSVP. - * - * @var RsvpResponseType [schema.org types: RsvpResponseType] + * @inheritdoc */ - public $rsvpResponse; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalNumberOfGuests', 'comment', 'rsvpResponse'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RsvpActionInterface.php b/src/models/jsonld/RsvpActionInterface.php new file mode 100644 index 000000000..51ccced20 --- /dev/null +++ b/src/models/jsonld/RsvpActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RsvpResponseMaybeInterface.php b/src/models/jsonld/RsvpResponseMaybeInterface.php new file mode 100644 index 000000000..7bbbefc25 --- /dev/null +++ b/src/models/jsonld/RsvpResponseMaybeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RsvpResponseNoInterface.php b/src/models/jsonld/RsvpResponseNoInterface.php new file mode 100644 index 000000000..5aa24f79b --- /dev/null +++ b/src/models/jsonld/RsvpResponseNoInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RsvpResponseTypeInterface.php b/src/models/jsonld/RsvpResponseTypeInterface.php new file mode 100644 index 000000000..e6d2cf5be --- /dev/null +++ b/src/models/jsonld/RsvpResponseTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/RsvpResponseYesInterface.php b/src/models/jsonld/RsvpResponseYesInterface.php new file mode 100644 index 000000000..6b88ac996 --- /dev/null +++ b/src/models/jsonld/RsvpResponseYesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SRPInterface.php b/src/models/jsonld/SRPInterface.php new file mode 100644 index 000000000..768a81be9 --- /dev/null +++ b/src/models/jsonld/SRPInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SafetyHealthAspectInterface.php b/src/models/jsonld/SafetyHealthAspectInterface.php new file mode 100644 index 000000000..453c0ed08 --- /dev/null +++ b/src/models/jsonld/SafetyHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SaleEventInterface.php b/src/models/jsonld/SaleEventInterface.php new file mode 100644 index 000000000..317285fba --- /dev/null +++ b/src/models/jsonld/SaleEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SalePriceInterface.php b/src/models/jsonld/SalePriceInterface.php new file mode 100644 index 000000000..2a095bc8d --- /dev/null +++ b/src/models/jsonld/SalePriceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SatireOrParodyContentInterface.php b/src/models/jsonld/SatireOrParodyContentInterface.php new file mode 100644 index 000000000..41a3056b7 --- /dev/null +++ b/src/models/jsonld/SatireOrParodyContentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'articleBody', - 'articleSection', - 'backstory', - 'pageEnd', - 'pageStart', - 'pagination', - 'speakable', - 'wordCount' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'articleBody' => ['Text'], - 'articleSection' => ['Text'], - 'backstory' => ['CreativeWork', 'Text'], - 'pageEnd' => ['Integer', 'Text'], - 'pageStart' => ['Integer', 'Text'], - 'pagination' => ['Text'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'wordCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'articleBody' => 'The actual body of the article.', - 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', - 'backstory' => 'For an Article, typically a NewsArticle, the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', - 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', - 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', - 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'wordCount' => 'The number of words in the text of the Article.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The actual body of the article. - * - * @var string [schema.org types: Text] - */ - public $articleBody; - /** - * Articles may belong to one or more 'sections' in a magazine or newspaper, - * such as Sports, Lifestyle, etc. - * - * @var string [schema.org types: Text] - */ - public $articleSection; - /** - * For an Article, typically a NewsArticle, the backstory property provides a - * textual summary giving a brief explanation of why and how an article was - * created. In a journalistic setting this could include information about - * reporting process, methods, interviews, data sources, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] + * @inheritdoc */ - public $backstory; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The page on which the work ends; for example "138" or "xvi". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageEnd; - /** - * The page on which the work starts; for example "135" or "xiii". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageStart; - /** - * Any description of pages that is not separated into pageStart and pageEnd; - * for example, "1-6, 9, 55" or "10-12, 46-49". - * - * @var string [schema.org types: Text] - */ - public $pagination; /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * The number of words in the text of the Article. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $wordCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['articleBody', 'articleSection', 'backstory', 'pageEnd', 'pageStart', 'pagination', 'speakable', 'wordCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SatiricalArticleInterface.php b/src/models/jsonld/SatiricalArticleInterface.php new file mode 100644 index 000000000..8b25cdc0a --- /dev/null +++ b/src/models/jsonld/SatiricalArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SaturdayInterface.php b/src/models/jsonld/SaturdayInterface.php new file mode 100644 index 000000000..6e22c092a --- /dev/null +++ b/src/models/jsonld/SaturdayInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'byDay' => ['DayOfWeek', 'Text'], + 'byMonth' => ['Integer'], + 'byMonthDay' => ['Integer'], + 'byMonthWeek' => ['Integer'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'endTime' => ['DateTime', 'Time'], + 'exceptDate' => ['DateTime', 'Date'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'repeatCount' => ['Integer'], + 'repeatFrequency' => ['Text', 'Duration'], + 'sameAs' => ['URL'], + 'scheduleTimezone' => ['Text'], + 'startDate' => ['DateTime', 'Date'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'byDay', - 'byMonth', - 'byMonthDay', - 'duration', - 'endDate', - 'exceptDate', - 'repeatCount', - 'repeatFrequency', - 'scheduleTimezone', - 'startDate' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'byDay' => ['DayOfWeek', 'Text'], - 'byMonth' => ['Integer'], - 'byMonthDay' => ['Integer'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'exceptDate' => ['Date', 'DateTime'], - 'repeatCount' => ['Integer'], - 'repeatFrequency' => ['Duration', 'Text'], - 'scheduleTimezone' => ['Text'], - 'startDate' => ['Date', 'DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'byDay' => 'Defines the day(s) of the week on which a recurring Event takes place. May be specified using either DayOfWeek, or alternatively Text conforming to iCal\'s syntax for byDay recurrence rules', - 'byMonth' => 'Defines the month(s) of the year on which a recurring Event takes place. Specified as an Integer between 1-12. January is 1.', - 'byMonthDay' => 'Defines the day(s) of the month on which a recurring Event takes place. Specified as an Integer between 1-31.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'exceptDate' => 'Defines a Date or DateTime during which a scheduled Event will not take place. The property allows exceptions to a Schedule to be specified. If an exception is specified as a DateTime then only the event that would have started at that specific date and time should be excluded from the schedule. If an exception is specified as a Date then any event that is scheduled for that 24 hour period should be excluded from the schedule. This allows a whole day to be excluded from the schedule without having to itemise every scheduled event.', - 'repeatCount' => 'Defines the number of times a recurring Event will take place', - 'repeatFrequency' => 'Defines the frequency at which Events will occur according to a schedule Schedule. The intervals between events should be defined as a Duration of time.', - 'scheduleTimezone' => 'Indicates the timezone for which the time(s) indicated in the Schedule are given. The value provided should be among those listed in the IANA Time Zone Database.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * Defines the day(s) of the week on which a recurring Event takes place. May - * be specified using either DayOfWeek, or alternatively Text conforming to - * iCal's syntax for byDay recurrence rules - * - * @var mixed|DayOfWeek|string [schema.org types: DayOfWeek, Text] - */ - public $byDay; - /** - * Defines the month(s) of the year on which a recurring Event takes place. - * Specified as an Integer between 1-12. January is 1. - * - * @var int [schema.org types: Integer] - */ - public $byMonth; - /** - * Defines the day(s) of the month on which a recurring Event takes place. - * Specified as an Integer between 1-31. - * - * @var int [schema.org types: Integer] - */ - public $byMonthDay; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $endDate; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'byDay' => 'Defines the day(s) of the week on which a recurring [[Event]] takes place. May be specified using either [[DayOfWeek]], or alternatively [[Text]] conforming to iCal\'s syntax for byDay recurrence rules.', + 'byMonth' => 'Defines the month(s) of the year on which a recurring [[Event]] takes place. Specified as an [[Integer]] between 1-12. January is 1.', + 'byMonthDay' => 'Defines the day(s) of the month on which a recurring [[Event]] takes place. Specified as an [[Integer]] between 1-31.', + 'byMonthWeek' => 'Defines the week(s) of the month on which a recurring Event takes place. Specified as an Integer between 1-5. For clarity, byMonthWeek is best used in conjunction with byDay to indicate concepts like the first and third Mondays of a month.', + 'description' => 'A description of the item.', + '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.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exceptDate' => 'Defines a [[Date]] or [[DateTime]] during which a scheduled [[Event]] will not take place. The property allows exceptions to a [[Schedule]] to be specified. If an exception is specified as a [[DateTime]] then only the event that would have started at that specific date and time should be excluded from the schedule. If an exception is specified as a [[Date]] then any event that is scheduled for that 24 hour period should be excluded from the schedule. This allows a whole day to be excluded from the schedule without having to itemise every scheduled event.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'repeatCount' => 'Defines the number of times a recurring [[Event]] will take place', + 'repeatFrequency' => 'Defines the frequency at which [[Event]]s will occur according to a schedule [[Schedule]]. The intervals between events should be defined as a [[Duration]] of time.', + '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.', + 'scheduleTimezone' => 'Indicates the timezone for which the time(s) indicated in the [[Schedule]] are given. The value provided should be among those listed in the IANA Time Zone Database.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Defines a Date or DateTime during which a scheduled Event will not take - * place. The property allows exceptions to a Schedule to be specified. If an - * exception is specified as a DateTime then only the event that would have - * started at that specific date and time should be excluded from the - * schedule. If an exception is specified as a Date then any event that is - * scheduled for that 24 hour period should be excluded from the schedule. - * This allows a whole day to be excluded from the schedule without having to - * itemise every scheduled event. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $exceptDate; /** - * Defines the number of times a recurring Event will take place - * - * @var int [schema.org types: Integer] - */ - public $repeatCount; - /** - * Defines the frequency at which Events will occur according to a schedule - * Schedule. The intervals between events should be defined as a Duration of - * time. - * - * @var mixed|Duration|string [schema.org types: Duration, Text] - */ - public $repeatFrequency; - /** - * Indicates the timezone for which the time(s) indicated in the Schedule are - * given. The value provided should be among those listed in the IANA Time - * Zone Database. - * - * @var string [schema.org types: Text] - */ - public $scheduleTimezone; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] + * @inheritdoc */ - public $startDate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['byDay', 'byMonth', 'byMonthDay', 'duration', 'endDate', 'exceptDate', 'repeatCount', 'repeatFrequency', 'scheduleTimezone', 'startDate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ScheduleAction.php b/src/models/jsonld/ScheduleAction.php index 733df0173..3d85f562f 100644 --- a/src/models/jsonld/ScheduleAction.php +++ b/src/models/jsonld/ScheduleAction.php @@ -1,30 +1,30 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'scheduledTime' => ['DateTime'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'scheduledTime' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'scheduledTime' => 'The time the object is scheduled to.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'scheduledTime' => ['DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'scheduledTime' => 'The time the object is scheduled to.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The time the object is scheduled to. - * - * @var DateTime [schema.org types: DateTime] + * @inheritdoc */ - public $scheduledTime; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['scheduledTime'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ScheduleActionInterface.php b/src/models/jsonld/ScheduleActionInterface.php new file mode 100644 index 000000000..04eea3539 --- /dev/null +++ b/src/models/jsonld/ScheduleActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'isResizable' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'isResizable' => 'Whether the 3DModel allows resizing. For example, room layout applications often do not allow 3DModel elements to be resized to reflect reality.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/Schema3DModelInterface.php b/src/models/jsonld/Schema3DModelInterface.php new file mode 100644 index 000000000..386de2d56 --- /dev/null +++ b/src/models/jsonld/Schema3DModelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SchemaClassInterface.php b/src/models/jsonld/SchemaClassInterface.php new file mode 100644 index 000000000..60a2f80d4 --- /dev/null +++ b/src/models/jsonld/SchemaClassInterface.php @@ -0,0 +1,24 @@ + ['Boolean'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'isResizable' => 'Whether the 3DModel allows resizing. For example, room layout applications often do not allow 3DModel elements to be resized to reflect reality.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Whether the 3DModel allows resizing. For example, room layout applications - * often do not allow 3DModel elements to be resized to reflect reality. - * - * @var bool [schema.org types: Boolean] - */ - public $isResizable; - - // Public Methods - // ========================================================================= - - /** - * @inheritdoc - */ - public function init(): void - { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); - } - - /** - * @inheritdoc - */ - public function rules(): array - { - $rules = parent::rules(); - $rules = array_merge($rules, [ - [['isResizable'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] - ]); - - return $rules; - } -} diff --git a/src/models/jsonld/Schema_Class.php b/src/models/jsonld/Schema_Class.php deleted file mode 100644 index 8138ba36c..000000000 --- a/src/models/jsonld/Schema_Class.php +++ /dev/null @@ -1,190 +0,0 @@ - ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] - */ - public $supersededBy; - - // Public Methods - // ========================================================================= - - /** - * @inheritdoc - */ - public function init(): void - { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); - } - - /** - * @inheritdoc - */ - public function rules(): array - { - $rules = parent::rules(); - $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] - ]); - - return $rules; - } -} diff --git a/src/models/jsonld/ScholarlyArticle.php b/src/models/jsonld/ScholarlyArticle.php index 5bc087e3a..90c924a1b 100644 --- a/src/models/jsonld/ScholarlyArticle.php +++ b/src/models/jsonld/ScholarlyArticle.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'articleBody', - 'articleSection', - 'backstory', - 'pageEnd', - 'pageStart', - 'pagination', - 'speakable', - 'wordCount' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'articleBody' => ['Text'], - 'articleSection' => ['Text'], - 'backstory' => ['CreativeWork', 'Text'], - 'pageEnd' => ['Integer', 'Text'], - 'pageStart' => ['Integer', 'Text'], - 'pagination' => ['Text'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'wordCount' => ['Integer'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'articleBody' => 'The actual body of the article.', - 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', - 'backstory' => 'For an Article, typically a NewsArticle, the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', - 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', - 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', - 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'wordCount' => 'The number of words in the text of the Article.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The actual body of the article. - * - * @var string [schema.org types: Text] - */ - public $articleBody; - /** - * Articles may belong to one or more 'sections' in a magazine or newspaper, - * such as Sports, Lifestyle, etc. - * - * @var string [schema.org types: Text] - */ - public $articleSection; - /** - * For an Article, typically a NewsArticle, the backstory property provides a - * textual summary giving a brief explanation of why and how an article was - * created. In a journalistic setting this could include information about - * reporting process, methods, interviews, data sources, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] + * @inheritdoc */ - public $backstory; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The page on which the work ends; for example "138" or "xvi". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageEnd; - /** - * The page on which the work starts; for example "135" or "xiii". - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $pageStart; - /** - * Any description of pages that is not separated into pageStart and pageEnd; - * for example, "1-6, 9, 55" or "10-12, 46-49". - * - * @var string [schema.org types: Text] - */ - public $pagination; /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * The number of words in the text of the Article. - * - * @var int [schema.org types: Integer] + * @inheritdoc */ - public $wordCount; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['articleBody', 'articleSection', 'backstory', 'pageEnd', 'pageStart', 'pagination', 'speakable', 'wordCount'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ScholarlyArticleInterface.php b/src/models/jsonld/ScholarlyArticleInterface.php new file mode 100644 index 000000000..d00ba6d25 --- /dev/null +++ b/src/models/jsonld/ScholarlyArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'alumni' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'alumni' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $alumni; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['alumni'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SchoolDistrict.php b/src/models/jsonld/SchoolDistrict.php index 23960e181..3cf4ef94f 100644 --- a/src/models/jsonld/SchoolDistrict.php +++ b/src/models/jsonld/SchoolDistrict.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SchoolDistrictInterface.php b/src/models/jsonld/SchoolDistrictInterface.php new file mode 100644 index 000000000..fcdb376a3 --- /dev/null +++ b/src/models/jsonld/SchoolDistrictInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'subtitleLanguage' => ['Language', 'Text'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'videoFormat' => ['Text'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'], + 'workPresented' => ['Movie'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'subtitleLanguage', - 'videoFormat', - 'workPresented' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'subtitleLanguage' => ['Language', 'Text'], - 'videoFormat' => ['Text'], - 'workPresented' => ['Movie'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'subtitleLanguage' => 'Languages in which subtitles/captions are available, in IETF BCP 47 standard format.', - 'videoFormat' => 'The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).', - 'workPresented' => 'The movie presented during this event.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'subtitleLanguage' => 'Languages in which subtitles/captions are available, in [IETF BCP 47 standard format](http://tools.ietf.org/html/bcp47).', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'videoFormat' => 'The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.', + 'workPresented' => 'The movie presented during this event.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Languages in which subtitles/captions are available, in IETF BCP 47 - * standard format. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $subtitleLanguage; - /** - * The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, - * etc.). - * - * @var string [schema.org types: Text] - */ - public $videoFormat; /** - * The movie presented during this event. - * - * @var Movie [schema.org types: Movie] + * @inheritdoc */ - public $workPresented; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['subtitleLanguage', 'videoFormat', 'workPresented'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ScreeningEventInterface.php b/src/models/jsonld/ScreeningEventInterface.php new file mode 100644 index 000000000..5a5657a31 --- /dev/null +++ b/src/models/jsonld/ScreeningEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ScreeningHealthAspectInterface.php b/src/models/jsonld/ScreeningHealthAspectInterface.php new file mode 100644 index 000000000..b7db55f24 --- /dev/null +++ b/src/models/jsonld/ScreeningHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SculptureInterface.php b/src/models/jsonld/SculptureInterface.php new file mode 100644 index 000000000..97d5ff14c --- /dev/null +++ b/src/models/jsonld/SculptureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SeaBodyOfWaterInterface.php b/src/models/jsonld/SeaBodyOfWaterInterface.php new file mode 100644 index 000000000..c4b8b3ff3 --- /dev/null +++ b/src/models/jsonld/SeaBodyOfWaterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'query' => ['Text'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'query' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'query' => 'A sub property of instrument. The query used on this action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'query' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'query' => 'A sub property of instrument. The query used on this action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of instrument. The query used on this action. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $query; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['query'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SearchActionInterface.php b/src/models/jsonld/SearchActionInterface.php new file mode 100644 index 000000000..f892db066 --- /dev/null +++ b/src/models/jsonld/SearchActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SearchRescueOrganizationInterface.php b/src/models/jsonld/SearchRescueOrganizationInterface.php new file mode 100644 index 000000000..2e2bb69d6 --- /dev/null +++ b/src/models/jsonld/SearchRescueOrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SearchResultsPageInterface.php b/src/models/jsonld/SearchResultsPageInterface.php new file mode 100644 index 000000000..0c3cf465d --- /dev/null +++ b/src/models/jsonld/SearchResultsPageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SeasonInterface.php b/src/models/jsonld/SeasonInterface.php new file mode 100644 index 000000000..3707dd66d --- /dev/null +++ b/src/models/jsonld/SeasonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'seatNumber' => ['Text'], + 'seatRow' => ['Text'], + 'seatSection' => ['Text'], + 'seatingType' => ['QualitativeValue', 'Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'seatNumber', - 'seatRow', - 'seatSection', - 'seatingType' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'seatNumber' => ['Text'], - 'seatRow' => ['Text'], - 'seatSection' => ['Text'], - 'seatingType' => ['QualitativeValue', 'Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'seatNumber' => 'The location of the reserved seat (e.g., 27).', - 'seatRow' => 'The row location of the reserved seat (e.g., B).', - 'seatSection' => 'The section location of the reserved seat (e.g. Orchestra).', - 'seatingType' => 'The type/class of the seat.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'seatNumber' => 'The location of the reserved seat (e.g., 27).', + 'seatRow' => 'The row location of the reserved seat (e.g., B).', + 'seatSection' => 'The section location of the reserved seat (e.g. Orchestra).', + 'seatingType' => 'The type/class of the seat.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The location of the reserved seat (e.g., 27). - * - * @var string [schema.org types: Text] - */ - public $seatNumber; - /** - * The row location of the reserved seat (e.g., B). - * - * @var string [schema.org types: Text] - */ - public $seatRow; - /** - * The section location of the reserved seat (e.g. Orchestra). - * - * @var string [schema.org types: Text] - */ - public $seatSection; /** - * The type/class of the seat. - * - * @var mixed|QualitativeValue|string [schema.org types: QualitativeValue, Text] + * @inheritdoc */ - public $seatingType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['seatNumber', 'seatRow', 'seatSection', 'seatingType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SeatInterface.php b/src/models/jsonld/SeatInterface.php new file mode 100644 index 000000000..38f743859 --- /dev/null +++ b/src/models/jsonld/SeatInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SeatingMapInterface.php b/src/models/jsonld/SeatingMapInterface.php new file mode 100644 index 000000000..fd7615a9e --- /dev/null +++ b/src/models/jsonld/SeatingMapInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SeeDoctorHealthAspectInterface.php b/src/models/jsonld/SeeDoctorHealthAspectInterface.php new file mode 100644 index 000000000..3d14b569d --- /dev/null +++ b/src/models/jsonld/SeeDoctorHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startOffset' => ['Number', 'HyperTocEntry'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SeekToActionInterface.php b/src/models/jsonld/SeekToActionInterface.php new file mode 100644 index 000000000..5704ca6ad --- /dev/null +++ b/src/models/jsonld/SeekToActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SelfCareHealthAspectInterface.php b/src/models/jsonld/SelfCareHealthAspectInterface.php new file mode 100644 index 000000000..f676278df --- /dev/null +++ b/src/models/jsonld/SelfCareHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SelfStorageInterface.php b/src/models/jsonld/SelfStorageInterface.php new file mode 100644 index 000000000..99a03756f --- /dev/null +++ b/src/models/jsonld/SelfStorageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'buyer' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'], + 'warrantyPromise' => ['WarrantyPromise'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'buyer' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'buyer' => 'A sub property of participant. The participant/person/organization that bought the object.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.', + 'warrantyPromise' => 'The warranty promise(s) included in the offer.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'buyer' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'buyer' => 'A sub property of participant. The participant/person/organization that bought the object.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The participant/person/organization that - * bought the object. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $buyer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['buyer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SellActionInterface.php b/src/models/jsonld/SellActionInterface.php new file mode 100644 index 000000000..4600046dd --- /dev/null +++ b/src/models/jsonld/SellActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'deliveryMethod' => ['DeliveryMethod'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'deliveryMethod', - 'recipient' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'deliveryMethod' => ['DeliveryMethod'], - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'deliveryMethod' => 'A sub property of instrument. The method of delivery.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'deliveryMethod' => 'A sub property of instrument. The method of delivery.', - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of instrument. The method of delivery. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] - */ - public $deliveryMethod; - /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['deliveryMethod', 'recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SendActionInterface.php b/src/models/jsonld/SendActionInterface.php new file mode 100644 index 000000000..43f49c7eb --- /dev/null +++ b/src/models/jsonld/SendActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SeriesInterface.php b/src/models/jsonld/SeriesInterface.php new file mode 100644 index 000000000..823d10499 --- /dev/null +++ b/src/models/jsonld/SeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'aggregateRating', - 'areaServed', - 'audience', - 'availableChannel', - 'award', - 'brand', - 'broker', - 'category', - 'hasOfferCatalog', - 'hoursAvailable', - 'isRelatedTo', - 'isSimilarTo', - 'logo', - 'offers', - 'provider', - 'providerMobility', - 'review', - 'serviceOutput', - 'serviceType', - 'slogan', - 'termsOfService' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'aggregateRating' => ['AggregateRating'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'audience' => ['Audience'], - 'availableChannel' => ['ServiceChannel'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'broker' => ['Organization', 'Person'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hoursAvailable' => ['OpeningHoursSpecification'], - 'isRelatedTo' => ['Product', 'Service'], - 'isSimilarTo' => ['Product', 'Service'], - 'logo' => ['ImageObject', 'URL'], - 'offers' => ['Demand', 'Offer'], - 'provider' => ['Organization', 'Person'], - 'providerMobility' => ['Text'], - 'review' => ['Review'], - 'serviceOutput' => ['Thing'], - 'serviceType' => ['Text'], - 'slogan' => ['Text'], - 'termsOfService' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - '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. Supersedes bookingAgent.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hoursAvailable' => 'The hours during which this service or contact is available.', - 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', - 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', - 'logo' => 'An associated logo.', - '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. Inverse property: itemOffered.', - '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. Supersedes carrier.', - 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', - 'review' => 'A review of the item. Supersedes reviews.', - 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc. Supersedes produces.', - 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', - 'slogan' => 'A slogan or motto associated with the item.', - 'termsOfService' => 'Human-readable terms of service documentation.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A means of accessing the service (e.g. a phone bank, a web site, a - * location, etc.). - * - * @var ServiceChannel [schema.org types: ServiceChannel] - */ - public $availableChannel; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * The hours during which this service or contact is available. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $hoursAvailable; - /** - * A pointer to another, somehow related product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isRelatedTo; - /** - * A pointer to another, functionally similar product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isSimilarTo; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * Indicates the mobility of a provided service (e.g. 'static', 'dynamic'). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $providerMobility; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * The tangible thing generated by the service, e.g. a passport, permit, etc. - * Supersedes produces. - * - * @var Thing [schema.org types: Thing] - */ - public $serviceOutput; - /** - * The type of service being offered, e.g. veterans' benefits, emergency - * relief, etc. - * - * @var string [schema.org types: Text] - */ - public $serviceType; /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Human-readable terms of service documentation. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $termsOfService; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['aggregateRating', 'areaServed', 'audience', 'availableChannel', 'award', 'brand', 'broker', 'category', 'hasOfferCatalog', 'hoursAvailable', 'isRelatedTo', 'isSimilarTo', 'logo', 'offers', 'provider', 'providerMobility', 'review', 'serviceOutput', 'serviceType', 'slogan', 'termsOfService'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ServiceChannel.php b/src/models/jsonld/ServiceChannel.php index 3e78e7652..ddad4572a 100644 --- a/src/models/jsonld/ServiceChannel.php +++ b/src/models/jsonld/ServiceChannel.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'availableLanguage' => ['Text', 'Language'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'processingTime' => ['Duration'], + 'providesService' => ['Service'], + 'sameAs' => ['URL'], + 'serviceLocation' => ['Place'], + 'servicePhone' => ['ContactPoint'], + 'servicePostalAddress' => ['PostalAddress'], + 'serviceSmsNumber' => ['ContactPoint'], + 'serviceUrl' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'availableLanguage', - 'processingTime', - 'providesService', - 'serviceLocation', - 'servicePhone', - 'servicePostalAddress', - 'serviceSmsNumber', - 'serviceUrl' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'availableLanguage' => ['Language', 'Text'], - 'processingTime' => ['Duration'], - 'providesService' => ['Service'], - 'serviceLocation' => ['Place'], - 'servicePhone' => ['ContactPoint'], - 'servicePostalAddress' => ['PostalAddress'], - 'serviceSmsNumber' => ['ContactPoint'], - 'serviceUrl' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. See also inLanguage', - 'processingTime' => 'Estimated processing time for the service using this channel.', - 'providesService' => 'The service provided by this channel.', - 'serviceLocation' => 'The location (e.g. civic structure, local business, etc.) where a person can go to access the service.', - 'servicePhone' => 'The phone number to use to access the service.', - 'servicePostalAddress' => 'The address for accessing the service by mail.', - 'serviceSmsNumber' => 'The number to access the service by text message.', - 'serviceUrl' => 'The website to access the service.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A language someone may use with or at the item, service or place. Please - * use one of the language codes from the IETF BCP 47 standard. See also - * inLanguage - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $availableLanguage; - /** - * Estimated processing time for the service using this channel. - * - * @var Duration [schema.org types: Duration] - */ - public $processingTime; - /** - * The service provided by this channel. - * - * @var Service [schema.org types: Service] + * @inheritdoc */ - public $providesService; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'processingTime' => 'Estimated processing time for the service using this channel.', + 'providesService' => 'The service provided by this channel.', + '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.', + 'serviceLocation' => 'The location (e.g. civic structure, local business, etc.) where a person can go to access the service.', + 'servicePhone' => 'The phone number to use to access the service.', + 'servicePostalAddress' => 'The address for accessing the service by mail.', + 'serviceSmsNumber' => 'The number to access the service by text message.', + 'serviceUrl' => 'The website to access the service.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The location (e.g. civic structure, local business, etc.) where a person - * can go to access the service. - * - * @var Place [schema.org types: Place] - */ - public $serviceLocation; - /** - * The phone number to use to access the service. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $servicePhone; - /** - * The address for accessing the service by mail. - * - * @var PostalAddress [schema.org types: PostalAddress] - */ - public $servicePostalAddress; /** - * The number to access the service by text message. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $serviceSmsNumber; - /** - * The website to access the service. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $serviceUrl; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['availableLanguage', 'processingTime', 'providesService', 'serviceLocation', 'servicePhone', 'servicePostalAddress', 'serviceSmsNumber', 'serviceUrl'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ServiceChannelInterface.php b/src/models/jsonld/ServiceChannelInterface.php new file mode 100644 index 000000000..1a298cffb --- /dev/null +++ b/src/models/jsonld/ServiceChannelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SexualContentConsiderationInterface.php b/src/models/jsonld/SexualContentConsiderationInterface.php new file mode 100644 index 000000000..f682f2433 --- /dev/null +++ b/src/models/jsonld/SexualContentConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'inLanguage', - 'recipient' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'inLanguage' => ['Language', 'Text'], - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. See also availableLanguage. Supersedes language.', - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'inLanguage', 'recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ShareActionInterface.php b/src/models/jsonld/ShareActionInterface.php new file mode 100644 index 000000000..7fdf8373d --- /dev/null +++ b/src/models/jsonld/ShareActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SheetMusicInterface.php b/src/models/jsonld/SheetMusicInterface.php new file mode 100644 index 000000000..4631c2486 --- /dev/null +++ b/src/models/jsonld/SheetMusicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'businessDays' => ['OpeningHoursSpecification'], + 'cutoffTime' => ['Time'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'handlingTime' => ['QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'transitTime' => ['QuantitativeValue'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'businessDays' => 'Days of the week when the merchant typically operates, indicated via opening hours markup.', + 'cutoffTime' => 'Order cutoff time allows merchants to describe the time after which they will no longer process orders received on that day. For orders processed after cutoff time, one day gets added to the delivery time estimate. This property is expected to be most typically used via the [[ShippingRateSettings]] publication pattern. The time is indicated using the ISO-8601 Time format, e.g. "23:30:00-05:00" would represent 6:30 pm Eastern Standard Time (EST) which is 5 hours behind Coordinated Universal Time (UTC).', + 'description' => 'A description of the item.', + '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.', + 'handlingTime' => 'The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup. Typical properties: minValue, maxValue, unitCode (d for DAY). This is by common convention assumed to mean business days (if a unitCode is used, coded as "d"), i.e. only counting days when the business normally operates.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'transitTime' => 'The typical delay the order has been sent for delivery and the goods reach the final customer. Typical properties: minValue, maxValue, unitCode (d for DAY).', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ShippingDeliveryTimeInterface.php b/src/models/jsonld/ShippingDeliveryTimeInterface.php new file mode 100644 index 000000000..ff7d492a9 --- /dev/null +++ b/src/models/jsonld/ShippingDeliveryTimeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doesNotShip' => ['Boolean'], + 'freeShippingThreshold' => ['MonetaryAmount', 'DeliveryChargeSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isUnlabelledFallback' => ['Boolean'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'shippingDestination' => ['DefinedRegion'], + 'shippingLabel' => ['Text'], + 'shippingRate' => ['MonetaryAmount'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'doesNotShip' => 'Indicates when shipping to a particular [[shippingDestination]] is not available.', + 'freeShippingThreshold' => 'A monetary value above which (or equal to) the shipping rate becomes free. Intended to be used via an [[OfferShippingDetails]] with [[shippingSettingsLink]] matching this [[ShippingRateSettings]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isUnlabelledFallback' => 'This can be marked \'true\' to indicate that some published [[DeliveryTimeSettings]] or [[ShippingRateSettings]] are intended to apply to all [[OfferShippingDetails]] published by the same merchant, when referenced by a [[shippingSettingsLink]] in those settings. It is not meaningful to use a \'true\' value for this property alongside a transitTimeLabel (for [[DeliveryTimeSettings]]) or shippingLabel (for [[ShippingRateSettings]]), since this property is for use with unlabelled settings.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'shippingDestination' => 'indicates (possibly multiple) shipping destinations. These can be defined in several ways e.g. postalCode ranges.', + 'shippingLabel' => 'Label to match an [[OfferShippingDetails]] with a [[ShippingRateSettings]] (within the context of a [[shippingSettingsLink]] cross-reference).', + 'shippingRate' => 'The shipping rate is the cost of shipping to the specified destination. Typically, the maxValue and currency values (of the [[MonetaryAmount]]) are most appropriate.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ShippingRateSettingsInterface.php b/src/models/jsonld/ShippingRateSettingsInterface.php new file mode 100644 index 000000000..56403b246 --- /dev/null +++ b/src/models/jsonld/ShippingRateSettingsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ShoeStoreInterface.php b/src/models/jsonld/ShoeStoreInterface.php new file mode 100644 index 000000000..bbb6e7a5f --- /dev/null +++ b/src/models/jsonld/ShoeStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ShoppingCenterInterface.php b/src/models/jsonld/ShoppingCenterInterface.php new file mode 100644 index 000000000..2fbda0006 --- /dev/null +++ b/src/models/jsonld/ShoppingCenterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. The number of interactions for the CreativeWork using the - * WebSite or SoftwareApplication. The most specific child type of - * InteractionCounter should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ShortStoryInterface.php b/src/models/jsonld/ShortStoryInterface.php new file mode 100644 index 000000000..2d5e0dd3b --- /dev/null +++ b/src/models/jsonld/ShortStoryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SideEffectsHealthAspectInterface.php b/src/models/jsonld/SideEffectsHealthAspectInterface.php new file mode 100644 index 000000000..790e25b52 --- /dev/null +++ b/src/models/jsonld/SideEffectsHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SingleBlindedTrialInterface.php b/src/models/jsonld/SingleBlindedTrialInterface.php new file mode 100644 index 000000000..d61a54f18 --- /dev/null +++ b/src/models/jsonld/SingleBlindedTrialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SingleCenterTrialInterface.php b/src/models/jsonld/SingleCenterTrialInterface.php new file mode 100644 index 000000000..46f53f567 --- /dev/null +++ b/src/models/jsonld/SingleCenterTrialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationCategory' => ['Text'], + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'floorLevel' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'occupancy' => ['QuantitativeValue'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'permittedUsage' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'], + 'yearBuilt' => ['Number'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'numberOfRooms', - 'occupancy' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'occupancy' => ['QuantitativeValue'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationCategory' => 'Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values).', + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'floorLevel' => 'The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'occupancy' => 'The allowed total occupancy for the accommodation in persons (including infants etc). For individual accommodations, this is not necessarily the legal maximum but defines the permitted usage as per the contractual agreement (e.g. a double room used by a single person). Typical unit code(s): C62 for person', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.', + 'yearBuilt' => 'The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). ' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'occupancy' => 'The allowed total occupancy for the accommodation in persons (including infants etc). For individual accommodations, this is not necessarily the legal maximum but defines the permitted usage as per the contractual agreement (e.g. a double room used by a single person). Typical unit code(s): C62 for person' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; - /** - * The allowed total occupancy for the accommodation in persons (including - * infants etc). For individual accommodations, this is not necessarily the - * legal maximum but defines the permitted usage as per the contractual - * agreement (e.g. a double room used by a single person). Typical unit - * code(s): C62 for person - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $occupancy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['numberOfRooms', 'occupancy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SingleFamilyResidenceInterface.php b/src/models/jsonld/SingleFamilyResidenceInterface.php new file mode 100644 index 000000000..a90cad7b5 --- /dev/null +++ b/src/models/jsonld/SingleFamilyResidenceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SinglePlayerInterface.php b/src/models/jsonld/SinglePlayerInterface.php new file mode 100644 index 000000000..2a78fcc9e --- /dev/null +++ b/src/models/jsonld/SinglePlayerInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SingleReleaseInterface.php b/src/models/jsonld/SingleReleaseInterface.php new file mode 100644 index 000000000..86d49c073 --- /dev/null +++ b/src/models/jsonld/SingleReleaseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'cssSelector' => ['CssSelectorType'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'xpath' => ['XPathType'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cssSelector', - 'xpath' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'cssSelector' => ['CssSelectorType'], - 'xpath' => ['XPathType'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'cssSelector' => 'A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'xpath' => 'An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cssSelector' => 'A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', - 'xpath' => 'An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the - * latter case, multiple matches within a page can constitute a single - * conceptual "Web page element". - * - * @var CssSelectorType [schema.org types: CssSelectorType] - */ - public $cssSelector; - /** - * An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter - * case, multiple matches within a page can constitute a single conceptual - * "Web page element". - * - * @var XPathType [schema.org types: XPathType] + * @inheritdoc */ - public $xpath; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cssSelector', 'xpath'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SiteNavigationElementInterface.php b/src/models/jsonld/SiteNavigationElementInterface.php new file mode 100644 index 000000000..2dee5e636 --- /dev/null +++ b/src/models/jsonld/SiteNavigationElementInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SizeGroupEnumerationInterface.php b/src/models/jsonld/SizeGroupEnumerationInterface.php new file mode 100644 index 000000000..2d1da247c --- /dev/null +++ b/src/models/jsonld/SizeGroupEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'hasMeasurement' => ['QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'sizeGroup' => ['Text', 'SizeGroupEnumeration'], + 'sizeSystem' => ['Text', 'SizeSystemEnumeration'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'suggestedAge' => ['QuantitativeValue'], + 'suggestedGender' => ['GenderType', 'Text'], + 'suggestedMeasurement' => ['QuantitativeValue'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'sizeGroup' => 'The size group (also known as "size type") for a product\'s size. Size groups are common in the fashion industry to define size segments and suggested audiences for wearable products. Multiple values can be combined, for example "men\'s big and tall", "petite maternity" or "regular"', + 'sizeSystem' => 'The size system used to identify a product\'s size. Typically either a standard (for example, "GS1" or "ISO-EN13402"), country code (for example "US" or "JP"), or a measuring system (for example "Metric" or "Imperial").', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'suggestedAge' => 'The age or age range for the intended audience or person, for example 3-12 months for infants, 1-5 years for toddlers.', + 'suggestedGender' => 'The suggested gender of the intended person or audience, for example "male", "female", or "unisex".', + 'suggestedMeasurement' => 'A suggested range of body measurements for the intended audience or person, for example inseam between 32 and 34 inches or height between 170 and 190 cm. Typically found on a size chart for wearable products.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SizeSpecificationInterface.php b/src/models/jsonld/SizeSpecificationInterface.php new file mode 100644 index 000000000..7783b15b8 --- /dev/null +++ b/src/models/jsonld/SizeSpecificationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SizeSystemEnumerationInterface.php b/src/models/jsonld/SizeSystemEnumerationInterface.php new file mode 100644 index 000000000..b59510e9e --- /dev/null +++ b/src/models/jsonld/SizeSystemEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SizeSystemImperialInterface.php b/src/models/jsonld/SizeSystemImperialInterface.php new file mode 100644 index 000000000..7ed866d31 --- /dev/null +++ b/src/models/jsonld/SizeSystemImperialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SizeSystemMetricInterface.php b/src/models/jsonld/SizeSystemMetricInterface.php new file mode 100644 index 000000000..8b5989ee8 --- /dev/null +++ b/src/models/jsonld/SizeSystemMetricInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableLanguage' => ['Text', 'Language'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'checkinTime' => ['DateTime', 'Time'], + 'checkoutTime' => ['DateTime', 'Time'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'checkinTime' => 'The earliest someone may check into a lodging establishment.', + 'checkoutTime' => 'The latest someone may check out of a lodging establishment.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SkiResortInterface.php b/src/models/jsonld/SkiResortInterface.php new file mode 100644 index 000000000..b5cae6cf9 --- /dev/null +++ b/src/models/jsonld/SkiResortInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SkinInterface.php b/src/models/jsonld/SkinInterface.php new file mode 100644 index 000000000..445c3a726 --- /dev/null +++ b/src/models/jsonld/SkinInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SocialEventInterface.php b/src/models/jsonld/SocialEventInterface.php new file mode 100644 index 000000000..2ab2da5fc --- /dev/null +++ b/src/models/jsonld/SocialEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sharedContent' => ['CreativeWork'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'sharedContent' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sharedContent' => 'A CreativeWork such as an image, video, or audio clip shared as part of this posting.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'sharedContent' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'sharedContent' => 'A CreativeWork such as an image, video, or audio clip shared as part of this posting.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - 'datePublished', - 'headline', - 'image' - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CreativeWork such as an image, video, or audio clip shared as part of - * this posting. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $sharedContent; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['sharedContent'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SocialMediaPostingInterface.php b/src/models/jsonld/SocialMediaPostingInterface.php new file mode 100644 index 000000000..13a8a125a --- /dev/null +++ b/src/models/jsonld/SocialMediaPostingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'applicationCategory' => ['Text', 'URL'], + 'applicationSubCategory' => ['URL', 'Text'], + 'applicationSuite' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'availableOnDevice' => ['Text'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countriesNotSupported' => ['Text'], + 'countriesSupported' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'device' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'downloadUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'featureList' => ['Text', 'URL'], + 'fileFormat' => ['URL', 'Text'], + 'fileSize' => ['Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'installUrl' => ['URL'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'memoryRequirements' => ['Text', 'URL'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'operatingSystem' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'permissions' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'processorRequirements' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releaseNotes' => ['URL', 'Text'], + 'releasedEvent' => ['PublicationEvent'], + 'requirements' => ['URL', 'Text'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'screenshot' => ['ImageObject', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'softwareAddOn' => ['SoftwareApplication'], + 'softwareHelp' => ['CreativeWork'], + 'softwareRequirements' => ['URL', 'Text'], + 'softwareVersion' => ['Text'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'storageRequirements' => ['URL', 'Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supportingData' => ['DataFeed'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'applicationCategory', - 'applicationSubCategory', - 'applicationSuite', - 'availableOnDevice', - 'countriesNotSupported', - 'countriesSupported', - 'downloadUrl', - 'featureList', - 'fileSize', - 'installUrl', - 'memoryRequirements', - 'operatingSystem', - 'permissions', - 'processorRequirements', - 'releaseNotes', - 'screenshot', - 'softwareAddOn', - 'softwareHelp', - 'softwareRequirements', - 'softwareVersion', - 'storageRequirements', - 'supportingData' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'applicationCategory' => ['Text', 'URL'], - 'applicationSubCategory' => ['Text', 'URL'], - 'applicationSuite' => ['Text'], - 'availableOnDevice' => ['Text'], - 'countriesNotSupported' => ['Text'], - 'countriesSupported' => ['Text'], - 'downloadUrl' => ['URL'], - 'featureList' => ['Text', 'URL'], - 'fileSize' => ['Text'], - 'installUrl' => ['URL'], - 'memoryRequirements' => ['Text', 'URL'], - 'operatingSystem' => ['Text'], - 'permissions' => ['Text'], - 'processorRequirements' => ['Text'], - 'releaseNotes' => ['Text', 'URL'], - 'screenshot' => ['ImageObject', 'URL'], - 'softwareAddOn' => ['SoftwareApplication'], - 'softwareHelp' => ['CreativeWork'], - 'softwareRequirements' => ['Text', 'URL'], - 'softwareVersion' => ['Text'], - 'storageRequirements' => ['Text', 'URL'], - 'supportingData' => ['DataFeed'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'applicationCategory' => 'Type of software application, e.g. \'Game, Multimedia\'.', - 'applicationSubCategory' => 'Subcategory of the application, e.g. \'Arcade Game\'.', - 'applicationSuite' => 'The name of the application suite to which the application belongs (e.g. Excel belongs to Office).', - 'availableOnDevice' => 'Device required to run the application. Used in cases where a specific make/model is required to run the application. Supersedes device.', - 'countriesNotSupported' => 'Countries for which the application is not supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', - 'countriesSupported' => 'Countries for which the application is supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', - 'downloadUrl' => 'If the file can be downloaded, URL to download the binary.', - 'featureList' => 'Features or modules provided by this application (and possibly required by other applications).', - 'fileSize' => 'Size of the application / package (e.g. 18MB). In the absence of a unit (MB, KB etc.), KB will be assumed.', - 'installUrl' => 'URL at which the app may be installed, if different from the URL of the item.', - 'memoryRequirements' => 'Minimum memory requirements.', - 'operatingSystem' => 'Operating systems supported (Windows 7, OSX 10.6, Android 1.6).', - 'permissions' => 'Permission(s) required to run the app (for example, a mobile app may require full internet access or may run only on wifi).', - 'processorRequirements' => 'Processor architecture required to run the application (e.g. IA64).', - 'releaseNotes' => 'Description of what changed in this version.', - 'screenshot' => 'A link to a screenshot image of the app.', - 'softwareAddOn' => 'Additional content for a software application.', - 'softwareHelp' => 'Software application help.', - 'softwareRequirements' => 'Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime). Supersedes requirements.', - 'softwareVersion' => 'Version of the software instance.', - 'storageRequirements' => 'Storage requirements (free space required).', - 'supportingData' => 'Supporting data for a SoftwareApplication.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Type of software application, e.g. 'Game, Multimedia'. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $applicationCategory; - /** - * Subcategory of the application, e.g. 'Arcade Game'. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $applicationSubCategory; - /** - * The name of the application suite to which the application belongs (e.g. - * Excel belongs to Office). - * - * @var string [schema.org types: Text] - */ - public $applicationSuite; - /** - * Device required to run the application. Used in cases where a specific - * make/model is required to run the application. Supersedes device. - * - * @var string [schema.org types: Text] - */ - public $availableOnDevice; - /** - * Countries for which the application is not supported. You can also provide - * the two-letter ISO 3166-1 alpha-2 country code. - * - * @var string [schema.org types: Text] - */ - public $countriesNotSupported; - /** - * Countries for which the application is supported. You can also provide the - * two-letter ISO 3166-1 alpha-2 country code. - * - * @var string [schema.org types: Text] - */ - public $countriesSupported; /** - * If the file can be downloaded, URL to download the binary. - * - * @var string [schema.org types: URL] - */ - public $downloadUrl; - /** - * Features or modules provided by this application (and possibly required by - * other applications). - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $featureList; - /** - * Size of the application / package (e.g. 18MB). In the absence of a unit - * (MB, KB etc.), KB will be assumed. - * - * @var string [schema.org types: Text] - */ - public $fileSize; - /** - * URL at which the app may be installed, if different from the URL of the - * item. - * - * @var string [schema.org types: URL] - */ - public $installUrl; - /** - * Minimum memory requirements. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $memoryRequirements; - /** - * Operating systems supported (Windows 7, OSX 10.6, Android 1.6). - * - * @var string [schema.org types: Text] - */ - public $operatingSystem; - /** - * Permission(s) required to run the app (for example, a mobile app may - * require full internet access or may run only on wifi). - * - * @var string [schema.org types: Text] - */ - public $permissions; - /** - * Processor architecture required to run the application (e.g. IA64). - * - * @var string [schema.org types: Text] - */ - public $processorRequirements; - /** - * Description of what changed in this version. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $releaseNotes; - /** - * A link to a screenshot image of the app. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $screenshot; - /** - * Additional content for a software application. - * - * @var SoftwareApplication [schema.org types: SoftwareApplication] + * @inheritdoc */ - public $softwareAddOn; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'applicationCategory' => 'Type of software application, e.g. \'Game, Multimedia\'.', + 'applicationSubCategory' => 'Subcategory of the application, e.g. \'Arcade Game\'.', + 'applicationSuite' => 'The name of the application suite to which the application belongs (e.g. Excel belongs to Office).', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'availableOnDevice' => 'Device required to run the application. Used in cases where a specific make/model is required to run the application.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countriesNotSupported' => 'Countries for which the application is not supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', + 'countriesSupported' => 'Countries for which the application is supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + 'device' => 'Device required to run the application. Used in cases where a specific make/model is required to run the application.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'downloadUrl' => 'If the file can be downloaded, URL to download the binary.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'featureList' => 'Features or modules provided by this application (and possibly required by other applications).', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'fileSize' => 'Size of the application / package (e.g. 18MB). In the absence of a unit (MB, KB etc.), KB will be assumed.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'installUrl' => 'URL at which the app may be installed, if different from the URL of the item.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'memoryRequirements' => 'Minimum memory requirements.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'operatingSystem' => 'Operating systems supported (Windows 7, OSX 10.6, Android 1.6).', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'permissions' => 'Permission(s) required to run the app (for example, a mobile app may require full internet access or may run only on wifi).', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'processorRequirements' => 'Processor architecture required to run the application (e.g. IA64).', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releaseNotes' => 'Description of what changed in this version.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requirements' => 'Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime).', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'screenshot' => 'A link to a screenshot image of the app.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'softwareAddOn' => 'Additional content for a software application.', + 'softwareHelp' => 'Software application help.', + 'softwareRequirements' => 'Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime).', + 'softwareVersion' => 'Version of the software instance.', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'storageRequirements' => 'Storage requirements (free space required).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supportingData' => 'Supporting data for a SoftwareApplication.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Software application help. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $softwareHelp; - /** - * Component dependency requirements for application. This includes runtime - * environments and shared libraries that are not included in the application - * distribution package, but required to run the application (Examples: - * DirectX, Java or .NET runtime). Supersedes requirements. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $softwareRequirements; - /** - * Version of the software instance. - * - * @var string [schema.org types: Text] - */ - public $softwareVersion; - /** - * Storage requirements (free space required). - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $storageRequirements; /** - * Supporting data for a SoftwareApplication. - * - * @var DataFeed [schema.org types: DataFeed] + * @inheritdoc */ - public $supportingData; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['applicationCategory', 'applicationSubCategory', 'applicationSuite', 'availableOnDevice', 'countriesNotSupported', 'countriesSupported', 'downloadUrl', 'featureList', 'fileSize', 'installUrl', 'memoryRequirements', 'operatingSystem', 'permissions', 'processorRequirements', 'releaseNotes', 'screenshot', 'softwareAddOn', 'softwareHelp', 'softwareRequirements', 'softwareVersion', 'storageRequirements', 'supportingData'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SoftwareApplicationInterface.php b/src/models/jsonld/SoftwareApplicationInterface.php new file mode 100644 index 000000000..21fd21145 --- /dev/null +++ b/src/models/jsonld/SoftwareApplicationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'codeRepository' => ['URL'], + 'codeSampleType' => ['Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'programmingLanguage' => ['Text', 'ComputerLanguage'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'runtime' => ['Text'], + 'runtimePlatform' => ['Text'], + 'sameAs' => ['URL'], + 'sampleType' => ['Text'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'targetProduct' => ['SoftwareApplication'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'codeRepository', - 'codeSampleType', - 'programmingLanguage', - 'runtimePlatform', - 'targetProduct' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'codeRepository' => ['URL'], - 'codeSampleType' => ['Text'], - 'programmingLanguage' => ['ComputerLanguage', 'Text'], - 'runtimePlatform' => ['Text'], - 'targetProduct' => ['SoftwareApplication'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'codeRepository' => 'Link to the repository where the un-compiled, human readable code and related code is located (SVN, github, CodePlex).', - 'codeSampleType' => 'What type of code sample: full (compile ready) solution, code snippet, inline code, scripts, template. Supersedes sampleType.', - 'programmingLanguage' => 'The computer programming language.', - 'runtimePlatform' => 'Runtime platform or script interpreter dependencies (Example - Java v1, Python2.3, .Net Framework 3.0). Supersedes runtime.', - 'targetProduct' => 'Target Operating System / Product to which the code applies. If applies to several versions, just the product name can be used.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'codeRepository' => 'Link to the repository where the un-compiled, human readable code and related code is located (SVN, github, CodePlex).', + 'codeSampleType' => 'What type of code sample: full (compile ready) solution, code snippet, inline code, scripts, template.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'programmingLanguage' => 'The computer programming language.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + 'runtime' => 'Runtime platform or script interpreter dependencies (Example - Java v1, Python2.3, .Net Framework 3.0).', + 'runtimePlatform' => 'Runtime platform or script interpreter dependencies (Example - Java v1, Python2.3, .Net Framework 3.0).', + '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.', + 'sampleType' => 'What type of code sample: full (compile ready) solution, code snippet, inline code, scripts, template.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'targetProduct' => 'Target Operating System / Product to which the code applies. If applies to several versions, just the product name can be used.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * Link to the repository where the un-compiled, human readable code and - * related code is located (SVN, github, CodePlex). - * - * @var string [schema.org types: URL] - */ - public $codeRepository; - /** - * What type of code sample: full (compile ready) solution, code snippet, - * inline code, scripts, template. Supersedes sampleType. - * - * @var string [schema.org types: Text] - */ - public $codeSampleType; - /** - * The computer programming language. - * - * @var mixed|ComputerLanguage|string [schema.org types: ComputerLanguage, Text] - */ - public $programmingLanguage; - /** - * Runtime platform or script interpreter dependencies (Example - Java v1, - * Python2.3, .Net Framework 3.0). Supersedes runtime. - * - * @var string [schema.org types: Text] - */ - public $runtimePlatform; - /** - * Target Operating System / Product to which the code applies. If applies to - * several versions, just the product name can be used. - * - * @var SoftwareApplication [schema.org types: SoftwareApplication] + * @inheritdoc */ - public $targetProduct; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['codeRepository', 'codeSampleType', 'programmingLanguage', 'runtimePlatform', 'targetProduct'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SoftwareSourceCodeInterface.php b/src/models/jsonld/SoftwareSourceCodeInterface.php new file mode 100644 index 000000000..a1a3ca81e --- /dev/null +++ b/src/models/jsonld/SoftwareSourceCodeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SoldOutInterface.php b/src/models/jsonld/SoldOutInterface.php new file mode 100644 index 000000000..04e997f6f --- /dev/null +++ b/src/models/jsonld/SoldOutInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eduQuestionType' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'eduQuestionType' => 'For questions that are part of learning resources (e.g. Quiz), eduQuestionType indicates the format of question being given. Example: "Multiple choice", "Open ended", "Flashcard".', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SolveMathActionInterface.php b/src/models/jsonld/SolveMathActionInterface.php new file mode 100644 index 000000000..0a6327857 --- /dev/null +++ b/src/models/jsonld/SolveMathActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'inventoryLevel' => ['QuantitativeValue'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'model' => ['ProductModel', 'Text'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'potentialAction' => ['Action'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'weight' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'inventoryLevel' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'inventoryLevel' => 'The current approximate inventory level for the item or items.', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'weight' => 'The weight of the product or person.', + 'width' => 'The width of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'inventoryLevel' => ['QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'inventoryLevel' => 'The current approximate inventory level for the item or items.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The current approximate inventory level for the item or items. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $inventoryLevel; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['inventoryLevel'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SomeProductsInterface.php b/src/models/jsonld/SomeProductsInterface.php new file mode 100644 index 000000000..c9434fe43 --- /dev/null +++ b/src/models/jsonld/SomeProductsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SoundtrackAlbumInterface.php b/src/models/jsonld/SoundtrackAlbumInterface.php new file mode 100644 index 000000000..f7b4d53f0 --- /dev/null +++ b/src/models/jsonld/SoundtrackAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'cssSelector' => ['CssSelectorType'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'xpath' => ['XPathType'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cssSelector', - 'xpath' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'cssSelector' => ['CssSelectorType'], - 'xpath' => ['XPathType'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'cssSelector' => 'A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'xpath' => 'An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cssSelector' => 'A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', - 'xpath' => 'An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the - * latter case, multiple matches within a page can constitute a single - * conceptual "Web page element". - * - * @var CssSelectorType [schema.org types: CssSelectorType] - */ - public $cssSelector; - /** - * An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter - * case, multiple matches within a page can constitute a single conceptual - * "Web page element". - * - * @var XPathType [schema.org types: XPathType] + * @inheritdoc */ - public $xpath; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cssSelector', 'xpath'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SpeakableSpecificationInterface.php b/src/models/jsonld/SpeakableSpecificationInterface.php new file mode 100644 index 000000000..473df3118 --- /dev/null +++ b/src/models/jsonld/SpeakableSpecificationInterface.php @@ -0,0 +1,24 @@ + ['CivicStructure', 'LocalBusiness'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'datePosted' => ['Date', 'DateTime'], - 'diseasePreventionInfo' => ['URL', 'WebContent'], - 'diseaseSpreadStatistics' => ['Dataset', 'Observation', 'URL', 'WebContent'], - 'gettingTestedInfo' => ['URL', 'WebContent'], - 'newsUpdatesAndGuidelines' => ['URL', 'WebContent'], - 'publicTransportClosuresInfo' => ['URL', 'WebContent'], - 'quarantineGuidelines' => ['URL', 'WebContent'], - 'schoolClosuresInfo' => ['URL', 'WebContent'], - 'travelBans' => ['URL', 'WebContent'], - 'webFeed' => ['DataFeed', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'announcementLocation' => 'Indicates a specific CivicStructure or LocalBusiness associated with the SpecialAnnouncement. For example, a specific testing facility or business with special opening hours. For a larger geographic region like a quarantine of an entire region, use spatialCoverage.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'datePosted' => 'Publication date of an online listing.', - 'diseasePreventionInfo' => 'Information about disease prevention.', - 'diseaseSpreadStatistics' => 'Statistical information about the spread of a disease, either as WebContent, or described directly as a Dataset, or the specific Observations in the dataset. When a WebContent URL is provided, the page indicated might also contain more such markup.', - 'gettingTestedInfo' => 'Information about getting tested (for a MedicalCondition), e.g. in the context of a pandemic.', - 'newsUpdatesAndGuidelines' => 'Indicates a page with news updates and guidelines. This could often be (but is not required to be) the main page containing SpecialAnnouncement markup on a site.', - 'publicTransportClosuresInfo' => 'Information about public transport closures.', - 'quarantineGuidelines' => 'Guidelines about quarantine rules, e.g. in the context of a pandemic.', - 'schoolClosuresInfo' => 'Information about school closures.', - 'travelBans' => 'Information about travel bans, e.g. in the context of a pandemic.', - 'webFeed' => 'The URL for a feed, e.g. associated with a podcast series, blog, or series of date-stamped updates. This is usually RSS or Atom.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates a specific CivicStructure or LocalBusiness associated with the - * SpecialAnnouncement. For example, a specific testing facility or business - * with special opening hours. For a larger geographic region like a - * quarantine of an entire region, use spatialCoverage. - * - * @var mixed|CivicStructure|LocalBusiness [schema.org types: CivicStructure, LocalBusiness] - */ - public $announcementLocation; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * Publication date of an online listing. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePosted; - /** - * Information about disease prevention. - * - * @var mixed|string|WebContent [schema.org types: URL, WebContent] - */ - public $diseasePreventionInfo; - /** - * Statistical information about the spread of a disease, either as - * WebContent, or described directly as a Dataset, or the specific - * Observations in the dataset. When a WebContent URL is provided, the page - * indicated might also contain more such markup. - * - * @var mixed|Dataset|Observation|string|WebContent [schema.org types: Dataset, Observation, URL, WebContent] - */ - public $diseaseSpreadStatistics; - /** - * Information about getting tested (for a MedicalCondition), e.g. in the - * context of a pandemic. - * - * @var mixed|string|WebContent [schema.org types: URL, WebContent] - */ - public $gettingTestedInfo; - /** - * Indicates a page with news updates and guidelines. This could often be (but - * is not required to be) the main page containing SpecialAnnouncement markup - * on a site. - * - * @var mixed|string|WebContent [schema.org types: URL, WebContent] - */ - public $newsUpdatesAndGuidelines; +We encourage the provision of "name", "text", "datePosted", "expires" (if appropriate), "category" and +"url" as a simple baseline. It is important to provide a value for "category" where possible, most ideally as a well known +URL from Wikipedia or Wikidata. In the case of the 2019-2020 Coronavirus pandemic, this should be "https://en.wikipedia.org/w/index.php?title=2019-20\_coronavirus\_pandemic" or "https://www.wikidata.org/wiki/Q81068910". + +For many of the possible properties, values can either be simple links or an inline description, depending on whether a summary is available. For a link, provide just the URL of the appropriate page as the property's value. For an inline description, use a [[WebContent]] type, and provide the url as a property of that, alongside at least a simple "[[text]]" summary of the page. It is +unlikely that a single SpecialAnnouncement will need all of the possible properties simultaneously. + +We expect that in many cases the page referenced might contain more specialized structured data, e.g. contact info, [[openingHours]], [[Event]], [[FAQPage]] etc. By linking to those pages from a [[SpecialAnnouncement]] you can help make it clearer that the events are related to the situation (e.g. Coronavirus) indicated by the [[category]] property of the [[SpecialAnnouncement]]. - // Static Protected Properties +Many [[SpecialAnnouncement]]s will relate to particular regions and to identifiable local organizations. Use [[spatialCoverage]] for the region, and [[announcementLocation]] to indicate specific [[LocalBusiness]]es and [[CivicStructure]]s. If the announcement affects both a particular region and a specific location (for example, a library closure that serves an entire region), use both [[spatialCoverage]] and [[announcementLocation]]. + +The [[about]] property can be used to indicate entities that are the focus of the announcement. We now recommend using [[about]] only +for representing non-location entities (e.g. a [[Course]] or a [[RadioStation]]). For places, use [[announcementLocation]] and [[spatialCoverage]]. Consumers of this markup should be aware that the initial design encouraged the use of /about for locations too. + +The basic content of [[SpecialAnnouncement]] is similar to that of an [RSS](https://en.wikipedia.org/wiki/RSS) or [Atom](https://en.wikipedia.org/wiki/Atom_(Web_standard)) feed. For publishers without such feeds, basic feed-like information can be shared by posting +[[SpecialAnnouncement]] updates in a page, e.g. using JSON-LD. For sites with Atom/RSS functionality, you can point to a feed +with the [[webFeed]] property. This can be a simple URL, or an inline [[DataFeed]] object, with [[encodingFormat]] providing +media type information e.g. "application/rss+xml" or "application/atom+xml". +SCHEMADESC; + + use SpecialAnnouncementTrait; + use CreativeWorkTrait; + use ThingTrait; + + // Public methods // ========================================================================= + /** - * Information about public transport closures. - * - * @var mixed|string|WebContent [schema.org types: URL, WebContent] - */ - public $publicTransportClosuresInfo; - /** - * Guidelines about quarantine rules, e.g. in the context of a pandemic. - * - * @var mixed|string|WebContent [schema.org types: URL, WebContent] + * @inheritdoc */ - public $quarantineGuidelines; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } + /** - * Information about school closures. - * - * @var mixed|string|WebContent [schema.org types: URL, WebContent] + * @inheritdoc */ - public $schoolClosuresInfo; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'announcementLocation' => ['CivicStructure', 'LocalBusiness'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePosted' => ['Date', 'DateTime'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'diseasePreventionInfo' => ['URL', 'WebContent'], + 'diseaseSpreadStatistics' => ['Dataset', 'Observation', 'WebContent', 'URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'gettingTestedInfo' => ['WebContent', 'URL'], + 'governmentBenefitsInfo' => ['GovernmentService'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'newsUpdatesAndGuidelines' => ['URL', 'WebContent'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publicTransportClosuresInfo' => ['URL', 'WebContent'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'quarantineGuidelines' => ['URL', 'WebContent'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'schoolClosuresInfo' => ['WebContent', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'travelBans' => ['URL', 'WebContent'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'webFeed' => ['DataFeed', 'URL'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + /** - * Information about travel bans, e.g. in the context of a pandemic. - * - * @var mixed|string|WebContent [schema.org types: URL, WebContent] + * @inheritdoc */ - public $travelBans; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'announcementLocation' => 'Indicates a specific [[CivicStructure]] or [[LocalBusiness]] associated with the SpecialAnnouncement. For example, a specific testing facility or business with special opening hours. For a larger geographic region like a quarantine of an entire region, use [[spatialCoverage]].', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePosted' => 'Publication date of an online listing.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'diseasePreventionInfo' => 'Information about disease prevention.', + 'diseaseSpreadStatistics' => 'Statistical information about the spread of a disease, either as [[WebContent]], or described directly as a [[Dataset]], or the specific [[Observation]]s in the dataset. When a [[WebContent]] URL is provided, the page indicated might also contain more such markup.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'gettingTestedInfo' => 'Information about getting tested (for a [[MedicalCondition]]), e.g. in the context of a pandemic.', + 'governmentBenefitsInfo' => 'governmentBenefitsInfo provides information about government benefits associated with a SpecialAnnouncement.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'newsUpdatesAndGuidelines' => 'Indicates a page with news updates and guidelines. This could often be (but is not required to be) the main page containing [[SpecialAnnouncement]] markup on a site.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publicTransportClosuresInfo' => 'Information about public transport closures.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'quarantineGuidelines' => 'Guidelines about quarantine rules, e.g. in the context of a pandemic.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'schoolClosuresInfo' => 'Information about school closures.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'travelBans' => 'Information about travel bans, e.g. in the context of a pandemic.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'webFeed' => 'The URL for a feed, e.g. associated with a podcast series, blog, or series of date-stamped updates. This is usually RSS or Atom.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + /** - * The URL for a feed, e.g. associated with a podcast series, blog, or series - * of date-stamped updates. This is usually RSS or Atom. - * - * @var mixed|DataFeed|string [schema.org types: DataFeed, URL] + * @inheritdoc */ - public $webFeed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['announcementLocation', 'category', 'datePosted', 'diseasePreventionInfo', 'diseaseSpreadStatistics', 'gettingTestedInfo', 'newsUpdatesAndGuidelines', 'publicTransportClosuresInfo', 'quarantineGuidelines', 'schoolClosuresInfo', 'travelBans', 'webFeed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SpecialAnnouncementInterface.php b/src/models/jsonld/SpecialAnnouncementInterface.php new file mode 100644 index 000000000..bee4c4ec9 --- /dev/null +++ b/src/models/jsonld/SpecialAnnouncementInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SpecialtyInterface.php b/src/models/jsonld/SpecialtyInterface.php new file mode 100644 index 000000000..7c10a1ffa --- /dev/null +++ b/src/models/jsonld/SpecialtyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SpeechPathologyInterface.php b/src/models/jsonld/SpeechPathologyInterface.php new file mode 100644 index 000000000..90772d588 --- /dev/null +++ b/src/models/jsonld/SpeechPathologyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SpokenWordAlbumInterface.php b/src/models/jsonld/SpokenWordAlbumInterface.php new file mode 100644 index 000000000..9530bad9f --- /dev/null +++ b/src/models/jsonld/SpokenWordAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SportingGoodsStoreInterface.php b/src/models/jsonld/SportingGoodsStoreInterface.php new file mode 100644 index 000000000..10c1d53ce --- /dev/null +++ b/src/models/jsonld/SportingGoodsStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SportsActivityLocationInterface.php b/src/models/jsonld/SportsActivityLocationInterface.php new file mode 100644 index 000000000..56d3dbf02 --- /dev/null +++ b/src/models/jsonld/SportsActivityLocationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SportsClubInterface.php b/src/models/jsonld/SportsClubInterface.php new file mode 100644 index 000000000..794f39b47 --- /dev/null +++ b/src/models/jsonld/SportsClubInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'awayTeam' => ['SportsTeam', 'Person'], + 'competitor' => ['Person', 'SportsTeam'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'homeTeam' => ['Person', 'SportsTeam'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'sport' => ['Text', 'URL'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'awayTeam', - 'competitor', - 'homeTeam', - 'sport' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'awayTeam' => ['Person', 'SportsTeam'], - 'competitor' => ['Person', 'SportsTeam'], - 'homeTeam' => ['Person', 'SportsTeam'], - 'sport' => ['Text', 'URL'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'awayTeam' => 'The away team in a sports event.', - 'competitor' => 'A competitor in a sports event.', - 'homeTeam' => 'The home team in a sports event.', - 'sport' => 'A type of sport (e.g. Baseball).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'awayTeam' => 'The away team in a sports event.', + 'competitor' => 'A competitor in a sports event.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'homeTeam' => 'The home team in a sports event.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'sport' => 'A type of sport (e.g. Baseball).', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The away team in a sports event. - * - * @var mixed|Person|SportsTeam [schema.org types: Person, SportsTeam] - */ - public $awayTeam; - /** - * A competitor in a sports event. - * - * @var mixed|Person|SportsTeam [schema.org types: Person, SportsTeam] - */ - public $competitor; - /** - * The home team in a sports event. - * - * @var mixed|Person|SportsTeam [schema.org types: Person, SportsTeam] - */ - public $homeTeam; /** - * A type of sport (e.g. Baseball). - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $sport; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['awayTeam', 'competitor', 'homeTeam', 'sport'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SportsEventInterface.php b/src/models/jsonld/SportsEventInterface.php new file mode 100644 index 000000000..5fdcc57ba --- /dev/null +++ b/src/models/jsonld/SportsEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'sport' => ['Text', 'URL'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'sport' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'sport' => 'A type of sport (e.g. Baseball).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'sport' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'sport' => 'A type of sport (e.g. Baseball).' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A type of sport (e.g. Baseball). - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $sport; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['sport'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SportsOrganizationInterface.php b/src/models/jsonld/SportsOrganizationInterface.php new file mode 100644 index 000000000..b0b294459 --- /dev/null +++ b/src/models/jsonld/SportsOrganizationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'athlete' => ['Person'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'coach' => ['Person'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'gender' => ['GenderType', 'Text'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'sport' => ['Text', 'URL'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'athlete', - 'coach', - 'gender' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'athlete' => ['Person'], - 'coach' => ['Person'], - 'gender' => ['GenderType', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'athlete' => 'A person that acts as performing member of a sports team; a player as opposed to a coach.', - 'coach' => 'A person that acts in a coaching role for a sports team.', - 'gender' => 'Gender of something, typically a Person, but possibly also fictional characters, animals, etc. While http://schema.org/Male and http://schema.org/Female may be used, text strings are also acceptable for people who do not identify as a binary gender. The gender property can also be used in an extended sense to cover e.g. the gender of sports teams. As with the gender of individuals, we do not try to enumerate all possibilities. A mixed-gender SportsTeam can be indicated with a text value of "Mixed".' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'athlete' => 'A person that acts as performing member of a sports team; a player as opposed to a coach.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'coach' => 'A person that acts in a coaching role for a sports team.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gender' => 'Gender of something, typically a [[Person]], but possibly also fictional characters, animals, etc. While https://schema.org/Male and https://schema.org/Female may be used, text strings are also acceptable for people who do not identify as a binary gender. The [[gender]] property can also be used in an extended sense to cover e.g. the gender of sports teams. As with the gender of individuals, we do not try to enumerate all possibilities. A mixed-gender [[SportsTeam]] can be indicated with a text value of "Mixed".', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'sport' => 'A type of sport (e.g. Baseball).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A person that acts as performing member of a sports team; a player as - * opposed to a coach. - * - * @var Person [schema.org types: Person] - */ - public $athlete; - /** - * A person that acts in a coaching role for a sports team. - * - * @var Person [schema.org types: Person] - */ - public $coach; /** - * Gender of something, typically a Person, but possibly also fictional - * characters, animals, etc. While http://schema.org/Male and - * http://schema.org/Female may be used, text strings are also acceptable for - * people who do not identify as a binary gender. The gender property can also - * be used in an extended sense to cover e.g. the gender of sports teams. As - * with the gender of individuals, we do not try to enumerate all - * possibilities. A mixed-gender SportsTeam can be indicated with a text value - * of "Mixed". - * - * @var mixed|GenderType|string [schema.org types: GenderType, Text] + * @inheritdoc */ - public $gender; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['athlete', 'coach', 'gender'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SportsTeamInterface.php b/src/models/jsonld/SportsTeamInterface.php new file mode 100644 index 000000000..c2b214951 --- /dev/null +++ b/src/models/jsonld/SportsTeamInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'hasDigitalDocumentPermission' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A permission related to the access to this document (e.g. permission to - * read or write an electronic document). For a public document, specify a - * grantee with an Audience with audienceType equal to "public". - * - * @var DigitalDocumentPermission [schema.org types: DigitalDocumentPermission] + * @inheritdoc */ - public $hasDigitalDocumentPermission; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasDigitalDocumentPermission'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SpreadsheetDigitalDocumentInterface.php b/src/models/jsonld/SpreadsheetDigitalDocumentInterface.php new file mode 100644 index 000000000..8c08c9e65 --- /dev/null +++ b/src/models/jsonld/SpreadsheetDigitalDocumentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/StadiumOrArenaInterface.php b/src/models/jsonld/StadiumOrArenaInterface.php new file mode 100644 index 000000000..99bbbedc0 --- /dev/null +++ b/src/models/jsonld/StadiumOrArenaInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/StagedContentInterface.php b/src/models/jsonld/StagedContentInterface.php new file mode 100644 index 000000000..a9321362a --- /dev/null +++ b/src/models/jsonld/StagedContentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/StagesHealthAspectInterface.php b/src/models/jsonld/StagesHealthAspectInterface.php new file mode 100644 index 000000000..69f7e8c3f --- /dev/null +++ b/src/models/jsonld/StagesHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/StateInterface.php b/src/models/jsonld/StateInterface.php new file mode 100644 index 000000000..0e97c02d1 --- /dev/null +++ b/src/models/jsonld/StateInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/StatementInterface.php b/src/models/jsonld/StatementInterface.php new file mode 100644 index 000000000..85a1debe5 --- /dev/null +++ b/src/models/jsonld/StatementInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'constrainingProperty' => ['Integer'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'numConstraints' => ['Integer'], + 'populationType' => ['Class'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'constrainingProperty', - 'numConstraints', - 'populationType' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'constrainingProperty' => ['Integer'], - 'numConstraints' => ['Integer'], - 'populationType' => ['Class'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'constrainingProperty' => 'Indicates a property used as a constraint to define a StatisticalPopulation with respect to the set of entities corresponding to an indicated type (via populationType).', - 'numConstraints' => 'Indicates the number of constraints (not counting populationType) defined for a particular StatisticalPopulation. This helps applications understand if they have access to a sufficiently complete description of a StatisticalPopulation.', - 'populationType' => 'Indicates the populationType common to all members of a StatisticalPopulation.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'constrainingProperty' => 'Indicates a property used as a constraint to define a [[StatisticalPopulation]] with respect to the set of entities corresponding to an indicated type (via [[populationType]]).', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'numConstraints' => 'Indicates the number of constraints (not counting [[populationType]]) defined for a particular [[StatisticalPopulation]]. This helps applications understand if they have access to a sufficiently complete description of a [[StatisticalPopulation]].', + 'populationType' => 'Indicates the populationType common to all members of a [[StatisticalPopulation]].', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates a property used as a constraint to define a StatisticalPopulation - * with respect to the set of entities corresponding to an indicated type (via - * populationType). - * - * @var int [schema.org types: Integer] - */ - public $constrainingProperty; - /** - * Indicates the number of constraints (not counting populationType) defined - * for a particular StatisticalPopulation. This helps applications understand - * if they have access to a sufficiently complete description of a - * StatisticalPopulation. - * - * @var int [schema.org types: Integer] - */ - public $numConstraints; /** - * Indicates the populationType common to all members of a - * StatisticalPopulation. - * - * @var Class [schema.org types: Class] + * @inheritdoc */ - public $populationType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['constrainingProperty', 'numConstraints', 'populationType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/StatisticalPopulationInterface.php b/src/models/jsonld/StatisticalPopulationInterface.php new file mode 100644 index 000000000..555f78502 --- /dev/null +++ b/src/models/jsonld/StatisticalPopulationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/StatusEnumerationInterface.php b/src/models/jsonld/StatusEnumerationInterface.php new file mode 100644 index 000000000..b153b5b52 --- /dev/null +++ b/src/models/jsonld/StatusEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'equal' => ['QualitativeValue'], + 'greater' => ['QualitativeValue'], + 'greaterOrEqual' => ['QualitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'lesser' => ['QualitativeValue'], + 'lesserOrEqual' => ['QualitativeValue'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'nonEqual' => ['QualitativeValue'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'], + 'valueReference' => ['Enumeration', 'DefinedTerm', 'Text', 'MeasurementTypeEnumeration', 'QualitativeValue', 'StructuredValue', 'PropertyValue', 'QuantitativeValue'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'equal', - 'greater', - 'greaterOrEqual', - 'lesser', - 'lesserOrEqual', - 'nonEqual', - 'valueReference' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'equal' => ['QualitativeValue'], - 'greater' => ['QualitativeValue'], - 'greaterOrEqual' => ['QualitativeValue'], - 'lesser' => ['QualitativeValue'], - 'lesserOrEqual' => ['QualitativeValue'], - 'nonEqual' => ['QualitativeValue'], - 'valueReference' => ['Enumeration', 'PropertyValue', 'QualitativeValue', 'QuantitativeValue', 'StructuredValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', - 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', - 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', - 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', - 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', - 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', - 'valueReference' => 'A pointer to a secondary value that provides additional information on the original value, e.g. a reference temperature.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * This ordering relation for qualitative values indicates that the subject is - * equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $equal; - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] + * @inheritdoc */ - public $greater; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'equal' => 'This ordering relation for qualitative values indicates that the subject is equal to the object.', + 'greater' => 'This ordering relation for qualitative values indicates that the subject is greater than the object.', + 'greaterOrEqual' => 'This ordering relation for qualitative values indicates that the subject is greater than or equal to the object.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'lesser' => 'This ordering relation for qualitative values indicates that the subject is lesser than the object.', + 'lesserOrEqual' => 'This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object.', + '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.', + 'name' => 'The name of the item.', + 'nonEqual' => 'This ordering relation for qualitative values indicates that the subject is not equal to the object.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.', + 'valueReference' => 'A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * This ordering relation for qualitative values indicates that the subject is - * greater than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $greaterOrEqual; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesser; - /** - * This ordering relation for qualitative values indicates that the subject is - * lesser than or equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $lesserOrEqual; /** - * This ordering relation for qualitative values indicates that the subject is - * not equal to the object. - * - * @var QualitativeValue [schema.org types: QualitativeValue] - */ - public $nonEqual; - /** - * A pointer to a secondary value that provides additional information on the - * original value, e.g. a reference temperature. - * - * @var mixed|Enumeration|PropertyValue|QualitativeValue|QuantitativeValue|StructuredValue [schema.org types: Enumeration, PropertyValue, QualitativeValue, QuantitativeValue, StructuredValue] + * @inheritdoc */ - public $valueReference; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'equal', 'greater', 'greaterOrEqual', 'lesser', 'lesserOrEqual', 'nonEqual', 'valueReference'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SteeringPositionValueInterface.php b/src/models/jsonld/SteeringPositionValueInterface.php new file mode 100644 index 000000000..210533a66 --- /dev/null +++ b/src/models/jsonld/SteeringPositionValueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/StoreCreditRefund.php b/src/models/jsonld/StoreCreditRefund.php index 5b34b8c4f..7e52cb1e3 100644 --- a/src/models/jsonld/StoreCreditRefund.php +++ b/src/models/jsonld/StoreCreditRefund.php @@ -1,27 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/StoreCreditRefundInterface.php b/src/models/jsonld/StoreCreditRefundInterface.php new file mode 100644 index 000000000..fafd271cc --- /dev/null +++ b/src/models/jsonld/StoreCreditRefundInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/StrengthTrainingInterface.php b/src/models/jsonld/StrengthTrainingInterface.php new file mode 100644 index 000000000..6a804feac --- /dev/null +++ b/src/models/jsonld/StrengthTrainingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/StructuredValueInterface.php b/src/models/jsonld/StructuredValueInterface.php new file mode 100644 index 000000000..bad76dbab --- /dev/null +++ b/src/models/jsonld/StructuredValueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/StudioAlbumInterface.php b/src/models/jsonld/StudioAlbumInterface.php new file mode 100644 index 000000000..9c0984e46 --- /dev/null +++ b/src/models/jsonld/StudioAlbumInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SubscribeActionInterface.php b/src/models/jsonld/SubscribeActionInterface.php new file mode 100644 index 000000000..7e4659a8e --- /dev/null +++ b/src/models/jsonld/SubscribeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/SubscriptionInterface.php b/src/models/jsonld/SubscriptionInterface.php new file mode 100644 index 000000000..ec7fe629f --- /dev/null +++ b/src/models/jsonld/SubscriptionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'activeIngredient' => ['Text'], + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumIntake' => ['MaximumDoseSchedule'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'activeIngredient', - 'maximumIntake' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'activeIngredient' => ['Text'], - 'maximumIntake' => ['MaximumDoseSchedule'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'activeIngredient' => 'An active ingredient, typically chemical compounds and/or biologic substances.', + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'maximumIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'activeIngredient' => 'An active ingredient, typically chemical compounds and/or biologic substances.', - 'maximumIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * An active ingredient, typically chemical compounds and/or biologic - * substances. - * - * @var string [schema.org types: Text] - */ - public $activeIngredient; - /** - * Recommended intake of this supplement for a given population as defined by - * a specific recommending authority. - * - * @var MaximumDoseSchedule [schema.org types: MaximumDoseSchedule] + * @inheritdoc */ - public $maximumIntake; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['activeIngredient', 'maximumIntake'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SubstanceInterface.php b/src/models/jsonld/SubstanceInterface.php new file mode 100644 index 000000000..f8fac104e --- /dev/null +++ b/src/models/jsonld/SubstanceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SubwayStationInterface.php b/src/models/jsonld/SubwayStationInterface.php new file mode 100644 index 000000000..27dbcacd4 --- /dev/null +++ b/src/models/jsonld/SubwayStationInterface.php @@ -0,0 +1,24 @@ +http://en.wikipedia.org/wiki/Suite_(hotel)). + * See also the dedicated document on the use + * of schema.org for marking up hotels and other forms of accommodations. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/Suite + * @see https://schema.org/Suite */ -class Suite extends Accommodation +class Suite extends MetaJsonLd implements SuiteInterface, AccommodationInterface, PlaceInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -36,187 +36,237 @@ class Suite extends Accommodation * * @var string */ - static public $schemaTypeName = 'Suite'; + static public string $schemaTypeName = 'Suite'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/Suite'; - - /** - * The Schema.org Type Description - * - * @var string - */ - static public $schemaTypeDescription = 'A suite in a hotel or other public accommodation, denotes a class of luxury accommodations, the key feature of which is multiple rooms (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Suite_(hotel)). See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations.'; + static public string $schemaTypeScope = 'https://schema.org/Suite'; /** * The Schema.org Type Extends * * @var string */ - static public $schemaTypeExtends = 'Accommodation'; + static public string $schemaTypeExtends = 'Accommodation'; /** - * The Schema.org composed Property Names + * The Schema.org Type Description * - * @var array + * @var string */ - static public $schemaPropertyNames = []; + static public string $schemaTypeDescription = <<http://en.wikipedia.org/wiki/Suite_(hotel)). +

+See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. +SCHEMADESC; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; + use SuiteTrait; + use AccommodationTrait; + use PlaceTrait; + use ThingTrait; - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accommodationCategory' => ['Text'], + 'accommodationFloorPlan' => ['FloorPlan'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'bed' => ['BedDetails', 'Text', 'BedType'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'floorLevel' => ['Text'], + 'floorSize' => ['QuantitativeValue'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'leaseLength' => ['QuantitativeValue', 'Duration'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'numberOfBathroomsTotal' => ['Integer'], + 'numberOfBedrooms' => ['Number', 'QuantitativeValue'], + 'numberOfFullBathrooms' => ['Number'], + 'numberOfPartialBathrooms' => ['Number'], + 'numberOfRooms' => ['QuantitativeValue', 'Number'], + 'occupancy' => ['QuantitativeValue'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'permittedUsage' => ['Text'], + 'petsAllowed' => ['Text', 'Boolean'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'], + 'yearBuilt' => ['Number'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bed', - 'numberOfRooms', - 'occupancy' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bed' => ['BedDetails', 'BedType', 'Text'], - 'numberOfRooms' => ['Number', 'QuantitativeValue'], - 'occupancy' => ['QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'bed' => 'The type of bed or beds included in the accommodation. For the single case of just one bed of a certain type, you use bed directly with a text. If you want to indicate the quantity of a certain kind of bed, use an instance of BedDetails. For more detailed information, use the amenityFeature property.', - 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', - 'occupancy' => 'The allowed total occupancy for the accommodation in persons (including infants etc). For individual accommodations, this is not necessarily the legal maximum but defines the permitted usage as per the contractual agreement (e.g. a double room used by a single person). Typical unit code(s): C62 for person' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accommodationCategory' => 'Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values).', + 'accommodationFloorPlan' => 'A floorplan of some [[Accommodation]].', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'bed' => 'The type of bed or beds included in the accommodation. For the single case of just one bed of a certain type, you use bed directly with a text. If you want to indicate the quantity of a certain kind of bed, use an instance of BedDetails. For more detailed information, use the amenityFeature property.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'floorLevel' => 'The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible.', + 'floorSize' => 'The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard ', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'leaseLength' => 'Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'numberOfBathroomsTotal' => 'The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]].', + 'numberOfBedrooms' => 'The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]].', + 'numberOfFullBathrooms' => 'Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).', + 'numberOfPartialBathrooms' => 'Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). ', + 'numberOfRooms' => 'The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.', + 'occupancy' => 'The allowed total occupancy for the accommodation in persons (including infants etc). For individual accommodations, this is not necessarily the legal maximum but defines the permitted usage as per the contractual agreement (e.g. a double room used by a single person). Typical unit code(s): C62 for person', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'permittedUsage' => 'Indications regarding the permitted usage of the accommodation.', + 'petsAllowed' => 'Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.', + 'yearBuilt' => 'The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). ' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The type of bed or beds included in the accommodation. For the single case - * of just one bed of a certain type, you use bed directly with a text. If you - * want to indicate the quantity of a certain kind of bed, use an instance of - * BedDetails. For more detailed information, use the amenityFeature property. - * - * @var mixed|BedDetails|BedType|string [schema.org types: BedDetails, BedType, Text] - */ - public $bed; - /** - * The number of rooms (excluding bathrooms and closets) of the accommodation - * or lodging business. Typical unit code(s): ROM for room or C62 for no unit. - * The type of room can be put in the unitText property of the - * QuantitativeValue. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfRooms; /** - * The allowed total occupancy for the accommodation in persons (including - * infants etc). For individual accommodations, this is not necessarily the - * legal maximum but defines the permitted usage as per the contractual - * agreement (e.g. a double room used by a single person). Typical unit - * code(s): C62 for person - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $occupancy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bed', 'numberOfRooms', 'occupancy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SuiteInterface.php b/src/models/jsonld/SuiteInterface.php new file mode 100644 index 000000000..82907d2ce --- /dev/null +++ b/src/models/jsonld/SuiteInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SundayInterface.php b/src/models/jsonld/SundayInterface.php new file mode 100644 index 000000000..3d8d69162 --- /dev/null +++ b/src/models/jsonld/SundayInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedAnatomy' => ['AnatomicalSystem', 'AnatomicalStructure'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'significance' => ['Text'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedPathophysiology', - 'relatedAnatomy', - 'relatedCondition', - 'relatedTherapy', - 'significance' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedPathophysiology' => ['Text'], - 'relatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem'], - 'relatedCondition' => ['MedicalCondition'], - 'relatedTherapy' => ['MedicalTherapy'], - 'significance' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', - 'relatedAnatomy' => 'Anatomical systems or structures that relate to the superficial anatomy.', - 'relatedCondition' => 'A medical condition associated with this anatomy.', - 'relatedTherapy' => 'A medical therapy related to this anatomy.', - 'significance' => 'The significance associated with the superficial anatomy; as an example, how characteristics of the superficial anatomy can suggest underlying medical conditions or courses of treatment.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedAnatomy' => 'Anatomical systems or structures that relate to the superficial anatomy.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'significance' => 'The significance associated with the superficial anatomy; as an example, how characteristics of the superficial anatomy can suggest underlying medical conditions or courses of treatment.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * If applicable, a description of the pathophysiology associated with the - * anatomical system, including potential abnormal changes in the mechanical, - * physical, and biochemical functions of the system. - * - * @var string [schema.org types: Text] - */ - public $associatedPathophysiology; - /** - * Anatomical systems or structures that relate to the superficial anatomy. - * - * @var mixed|AnatomicalStructure|AnatomicalSystem [schema.org types: AnatomicalStructure, AnatomicalSystem] - */ - public $relatedAnatomy; - /** - * A medical condition associated with this anatomy. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $relatedCondition; - /** - * A medical therapy related to this anatomy. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $relatedTherapy; - /** - * The significance associated with the superficial anatomy; as an example, - * how characteristics of the superficial anatomy can suggest underlying - * medical conditions or courses of treatment. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $significance; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedPathophysiology', 'relatedAnatomy', 'relatedCondition', 'relatedTherapy', 'significance'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SuperficialAnatomyInterface.php b/src/models/jsonld/SuperficialAnatomyInterface.php new file mode 100644 index 000000000..ac4ecce60 --- /dev/null +++ b/src/models/jsonld/SuperficialAnatomyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SurgicalInterface.php b/src/models/jsonld/SurgicalInterface.php new file mode 100644 index 000000000..1d819cbb5 --- /dev/null +++ b/src/models/jsonld/SurgicalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bodyLocation', - 'followup', - 'howPerformed', - 'preparation', - 'procedureType', - 'status' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bodyLocation' => ['Text'], - 'followup' => ['Text'], - 'howPerformed' => ['Text'], - 'preparation' => ['MedicalEntity', 'Text'], - 'procedureType' => ['MedicalProcedureType'], - 'status' => ['EventStatusType', 'MedicalStudyStatus', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bodyLocation' => 'Location in the body of the anatomical structure.', - 'followup' => 'Typical or recommended followup care after the procedure is performed.', - 'howPerformed' => 'How the procedure is performed.', - 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', - 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', - 'status' => 'The status of the study (enumerated).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * Location in the body of the anatomical structure. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $bodyLocation; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Typical or recommended followup care after the procedure is performed. - * - * @var string [schema.org types: Text] - */ - public $followup; /** - * How the procedure is performed. - * - * @var string [schema.org types: Text] - */ - public $howPerformed; - /** - * Typical preparation that a patient must undergo before having the procedure - * performed. - * - * @var mixed|MedicalEntity|string [schema.org types: MedicalEntity, Text] - */ - public $preparation; - /** - * The type of procedure, for example Surgical, Noninvasive, or Percutaneous. - * - * @var MedicalProcedureType [schema.org types: MedicalProcedureType] - */ - public $procedureType; - /** - * The status of the study (enumerated). - * - * @var mixed|EventStatusType|MedicalStudyStatus|string [schema.org types: EventStatusType, MedicalStudyStatus, Text] + * @inheritdoc */ - public $status; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bodyLocation', 'followup', 'howPerformed', 'preparation', 'procedureType', 'status'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SurgicalProcedureInterface.php b/src/models/jsonld/SurgicalProcedureInterface.php new file mode 100644 index 000000000..071075f49 --- /dev/null +++ b/src/models/jsonld/SurgicalProcedureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SuspendActionInterface.php b/src/models/jsonld/SuspendActionInterface.php new file mode 100644 index 000000000..3c5890a4a --- /dev/null +++ b/src/models/jsonld/SuspendActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SuspendedInterface.php b/src/models/jsonld/SuspendedInterface.php new file mode 100644 index 000000000..b29eaa267 --- /dev/null +++ b/src/models/jsonld/SuspendedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SymptomsHealthAspectInterface.php b/src/models/jsonld/SymptomsHealthAspectInterface.php new file mode 100644 index 000000000..30713f61d --- /dev/null +++ b/src/models/jsonld/SymptomsHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/SynagogueInterface.php b/src/models/jsonld/SynagogueInterface.php new file mode 100644 index 000000000..ba2026db8 --- /dev/null +++ b/src/models/jsonld/SynagogueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'clipNumber' => ['Text', 'Integer'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endOffset' => ['Number', 'HyperTocEntry'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfEpisode' => ['Episode'], + 'partOfSeason' => ['CreativeWorkSeason'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'partOfTVSeries' => ['TVSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startOffset' => ['Number', 'HyperTocEntry'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'clipNumber', - 'director', - 'endOffset', - 'musicBy', - 'partOfEpisode', - 'partOfSeason', - 'partOfSeries', - 'startOffset' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'clipNumber' => ['Integer', 'Text'], - 'director' => ['Person'], - 'endOffset' => ['Number'], - 'musicBy' => ['MusicGroup', 'Person'], - 'partOfEpisode' => ['Episode'], - 'partOfSeason' => ['CreativeWorkSeason'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'startOffset' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'clipNumber' => 'Position of the clip within an ordered group of clips.', - '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. Supersedes directors.', - 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', - 'musicBy' => 'The composer of the soundtrack.', - 'partOfEpisode' => 'The episode to which this clip belongs.', - 'partOfSeason' => 'The season to which this episode belongs.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * Position of the clip within an ordered group of clips. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $clipNumber; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The end time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $endOffset; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'clipNumber' => 'Position of the clip within an ordered group of clips.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'partOfEpisode' => 'The episode to which this clip belongs.', + 'partOfSeason' => 'The season to which this episode belongs.', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'partOfTVSeries' => 'The TV series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The episode to which this clip belongs. - * - * @var Episode [schema.org types: Episode] - */ - public $partOfEpisode; - /** - * The season to which this episode belongs. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $partOfSeason; - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; - /** - * The start time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $startOffset; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'clipNumber', 'director', 'endOffset', 'musicBy', 'partOfEpisode', 'partOfSeason', 'partOfSeries', 'startOffset'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TVClipInterface.php b/src/models/jsonld/TVClipInterface.php new file mode 100644 index 000000000..4842a0fc8 --- /dev/null +++ b/src/models/jsonld/TVClipInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'episodeNumber' => ['Integer', 'Text'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfSeason' => ['CreativeWorkSeason'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'partOfTVSeries' => ['TVSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'subtitleLanguage' => ['Language', 'Text'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'titleEIDR' => ['URL', 'Text'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'countryOfOrigin', - 'subtitleLanguage' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'countryOfOrigin' => ['Country'], - 'subtitleLanguage' => ['Language', 'Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'episodeNumber' => 'Position of the episode within an ordered group of episodes.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'partOfSeason' => 'The season to which this episode belongs.', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'partOfTVSeries' => 'The TV series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'subtitleLanguage' => 'Languages in which subtitles/captions are available, in [IETF BCP 47 standard format](http://tools.ietf.org/html/bcp47).', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'titleEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing at the most general/abstract level, a work of film or television. For example, the motion picture known as "Ghostbusters" has a titleEIDR of "10.5240/7EC7-228A-510A-053E-CBB8-J". This title (or work) may have several variants, which EIDR calls "edits". See [[editEIDR]]. Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'countryOfOrigin' => 'The country of the principal offices of the production company or individual responsible for the movie or program.', - 'subtitleLanguage' => 'Languages in which subtitles/captions are available, in IETF BCP 47 standard format.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The country of the principal offices of the production company or - * individual responsible for the movie or program. - * - * @var Country [schema.org types: Country] - */ - public $countryOfOrigin; - /** - * Languages in which subtitles/captions are available, in IETF BCP 47 - * standard format. - * - * @var mixed|Language|string [schema.org types: Language, Text] + * @inheritdoc */ - public $subtitleLanguage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['countryOfOrigin', 'subtitleLanguage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TVEpisodeInterface.php b/src/models/jsonld/TVEpisodeInterface.php new file mode 100644 index 000000000..bdba23b97 --- /dev/null +++ b/src/models/jsonld/TVEpisodeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'episode' => ['Episode'], + 'episodes' => ['Episode'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'numberOfEpisodes' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'partOfTVSeries' => ['TVSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'seasonNumber' => ['Text', 'Integer'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'countryOfOrigin' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'episode' => 'An episode of a tv, radio or game media within a series or season.', + 'episodes' => 'An episode of a TV/radio series or season.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'numberOfEpisodes' => 'The number of episodes in this season or series.', + '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. ', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'partOfTVSeries' => 'The TV series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'seasonNumber' => 'Position of the season within an ordered group of seasons.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'countryOfOrigin' => ['Country'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'countryOfOrigin' => 'The country of the principal offices of the production company or individual responsible for the movie or program.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The country of the principal offices of the production company or - * individual responsible for the movie or program. - * - * @var Country [schema.org types: Country] + * @inheritdoc */ - public $countryOfOrigin; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['countryOfOrigin'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TVSeasonInterface.php b/src/models/jsonld/TVSeasonInterface.php new file mode 100644 index 000000000..7349894c9 --- /dev/null +++ b/src/models/jsonld/TVSeasonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'containsSeason' => ['CreativeWorkSeason'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'episode' => ['Episode'], + 'episodes' => ['Episode'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'numberOfEpisodes' => ['Integer'], + 'numberOfSeasons' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'season' => ['URL', 'CreativeWorkSeason'], + 'seasons' => ['CreativeWorkSeason'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'containsSeason', - 'countryOfOrigin', - 'director', - 'episode', - 'musicBy', - 'numberOfEpisodes', - 'numberOfSeasons', - 'productionCompany', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'containsSeason' => ['CreativeWorkSeason'], - 'countryOfOrigin' => ['Country'], - 'director' => ['Person'], - 'episode' => ['Episode'], - 'musicBy' => ['MusicGroup', 'Person'], - 'numberOfEpisodes' => ['Integer'], - 'numberOfSeasons' => ['Integer'], - 'productionCompany' => ['Organization'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'containsSeason' => 'A season that is part of the media series. Supersedes season.', - 'countryOfOrigin' => 'The country of the principal offices of the production company or individual responsible for the movie or program.', - '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. Supersedes directors.', - 'episode' => 'An episode of a tv, radio or game media within a series or season. Supersedes episodes.', - 'musicBy' => 'The composer of the soundtrack.', - 'numberOfEpisodes' => 'The number of episodes in this season or series.', - 'numberOfSeasons' => 'The number of seasons in this series.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * A season that is part of the media series. Supersedes season. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $containsSeason; - /** - * The country of the principal offices of the production company or - * individual responsible for the movie or program. - * - * @var Country [schema.org types: Country] - */ - public $countryOfOrigin; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * An episode of a tv, radio or game media within a series or season. - * Supersedes episodes. - * - * @var Episode [schema.org types: Episode] + * @inheritdoc */ - public $episode; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'containsSeason' => 'A season that is part of the media series.', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'episode' => 'An episode of a tv, radio or game media within a series or season.', + 'episodes' => 'An episode of a TV/radio series or season.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + 'numberOfEpisodes' => 'The number of episodes in this season or series.', + 'numberOfSeasons' => 'The number of seasons in this series.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'season' => 'A season in a media series.', + 'seasons' => 'A season in a media series.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; /** - * The number of episodes in this season or series. - * - * @var int [schema.org types: Integer] - */ - public $numberOfEpisodes; - /** - * The number of seasons in this series. - * - * @var int [schema.org types: Integer] - */ - public $numberOfSeasons; - /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'containsSeason', 'countryOfOrigin', 'director', 'episode', 'musicBy', 'numberOfEpisodes', 'numberOfSeasons', 'productionCompany', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TVSeriesInterface.php b/src/models/jsonld/TVSeriesInterface.php new file mode 100644 index 000000000..e65623939 --- /dev/null +++ b/src/models/jsonld/TVSeriesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'cssSelector' => ['CssSelectorType'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'xpath' => ['XPathType'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cssSelector', - 'xpath' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'cssSelector' => ['CssSelectorType'], - 'xpath' => ['XPathType'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'cssSelector' => 'A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'xpath' => 'An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cssSelector' => 'A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', - 'xpath' => 'An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the - * latter case, multiple matches within a page can constitute a single - * conceptual "Web page element". - * - * @var CssSelectorType [schema.org types: CssSelectorType] - */ - public $cssSelector; - /** - * An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter - * case, multiple matches within a page can constitute a single conceptual - * "Web page element". - * - * @var XPathType [schema.org types: XPathType] + * @inheritdoc */ - public $xpath; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cssSelector', 'xpath'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TableInterface.php b/src/models/jsonld/TableInterface.php new file mode 100644 index 000000000..7cf24bf8a --- /dev/null +++ b/src/models/jsonld/TableInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'fromLocation', - 'toLocation' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'fromLocation' => ['Place'], - 'toLocation' => ['Place'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The original location of the object or the - * agent before the action. - * - * @var Place [schema.org types: Place] - */ - public $fromLocation; - /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['fromLocation', 'toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TakeActionInterface.php b/src/models/jsonld/TakeActionInterface.php new file mode 100644 index 000000000..90d582556 --- /dev/null +++ b/src/models/jsonld/TakeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TattooParlorInterface.php b/src/models/jsonld/TattooParlorInterface.php new file mode 100644 index 000000000..9621e3c34 --- /dev/null +++ b/src/models/jsonld/TattooParlorInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/TaxiInterface.php b/src/models/jsonld/TaxiInterface.php new file mode 100644 index 000000000..54d1f1ae3 --- /dev/null +++ b/src/models/jsonld/TaxiInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'partySize' => ['Integer', 'QuantitativeValue'], + 'pickupLocation' => ['Place'], + 'pickupTime' => ['DateTime'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'partySize', - 'pickupLocation', - 'pickupTime' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'partySize' => ['Integer', 'QuantitativeValue'], - 'pickupLocation' => ['Place'], - 'pickupTime' => ['DateTime'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'partySize' => 'Number of people the reservation should accommodate.', - 'pickupLocation' => 'Where a taxi will pick up a passenger or a rental car can be picked up.', - 'pickupTime' => 'When a taxi will pickup a passenger or a rental car can be picked up.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'partySize' => 'Number of people the reservation should accommodate.', + 'pickupLocation' => 'Where a taxi will pick up a passenger or a rental car can be picked up.', + 'pickupTime' => 'When a taxi will pickup a passenger or a rental car can be picked up.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Number of people the reservation should accommodate. - * - * @var mixed|int|QuantitativeValue [schema.org types: Integer, QuantitativeValue] - */ - public $partySize; - /** - * Where a taxi will pick up a passenger or a rental car can be picked up. - * - * @var Place [schema.org types: Place] - */ - public $pickupLocation; /** - * When a taxi will pickup a passenger or a rental car can be picked up. - * - * @var DateTime [schema.org types: DateTime] + * @inheritdoc */ - public $pickupTime; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['partySize', 'pickupLocation', 'pickupTime'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TaxiReservationInterface.php b/src/models/jsonld/TaxiReservationInterface.php new file mode 100644 index 000000000..0f2f6ca03 --- /dev/null +++ b/src/models/jsonld/TaxiReservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'aggregateRating', - 'areaServed', - 'audience', - 'availableChannel', - 'award', - 'brand', - 'broker', - 'category', - 'hasOfferCatalog', - 'hoursAvailable', - 'isRelatedTo', - 'isSimilarTo', - 'logo', - 'offers', - 'provider', - 'providerMobility', - 'review', - 'serviceOutput', - 'serviceType', - 'slogan', - 'termsOfService' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'aggregateRating' => ['AggregateRating'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'audience' => ['Audience'], - 'availableChannel' => ['ServiceChannel'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'broker' => ['Organization', 'Person'], - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hoursAvailable' => ['OpeningHoursSpecification'], - 'isRelatedTo' => ['Product', 'Service'], - 'isSimilarTo' => ['Product', 'Service'], - 'logo' => ['ImageObject', 'URL'], - 'offers' => ['Demand', 'Offer'], - 'provider' => ['Organization', 'Person'], - 'providerMobility' => ['Text'], - 'review' => ['Review'], - 'serviceOutput' => ['Thing'], - 'serviceType' => ['Text'], - 'slogan' => ['Text'], - 'termsOfService' => ['Text', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - '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. Supersedes bookingAgent.', - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hoursAvailable' => 'The hours during which this service or contact is available.', - 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', - 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', - 'logo' => 'An associated logo.', - '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. Inverse property: itemOffered.', - '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. Supersedes carrier.', - 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', - 'review' => 'A review of the item. Supersedes reviews.', - 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc. Supersedes produces.', - 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', - 'slogan' => 'A slogan or motto associated with the item.', - 'termsOfService' => 'Human-readable terms of service documentation.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * A means of accessing the service (e.g. a phone bank, a web site, a - * location, etc.). - * - * @var ServiceChannel [schema.org types: ServiceChannel] - */ - public $availableChannel; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] - */ - public $category; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * The hours during which this service or contact is available. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $hoursAvailable; - /** - * A pointer to another, somehow related product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isRelatedTo; - /** - * A pointer to another, functionally similar product (or multiple products). - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $isSimilarTo; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * Indicates the mobility of a provided service (e.g. 'static', 'dynamic'). - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $providerMobility; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * The tangible thing generated by the service, e.g. a passport, permit, etc. - * Supersedes produces. - * - * @var Thing [schema.org types: Thing] - */ - public $serviceOutput; - /** - * The type of service being offered, e.g. veterans' benefits, emergency - * relief, etc. - * - * @var string [schema.org types: Text] - */ - public $serviceType; /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Human-readable terms of service documentation. - * - * @var mixed|string|string [schema.org types: Text, URL] + * @inheritdoc */ - public $termsOfService; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['aggregateRating', 'areaServed', 'audience', 'availableChannel', 'award', 'brand', 'broker', 'category', 'hasOfferCatalog', 'hoursAvailable', 'isRelatedTo', 'isSimilarTo', 'logo', 'offers', 'provider', 'providerMobility', 'review', 'serviceOutput', 'serviceType', 'slogan', 'termsOfService'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TaxiServiceInterface.php b/src/models/jsonld/TaxiServiceInterface.php new file mode 100644 index 000000000..243ac4b5f --- /dev/null +++ b/src/models/jsonld/TaxiServiceInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TaxiStandInterface.php b/src/models/jsonld/TaxiStandInterface.php new file mode 100644 index 000000000..b88d120da --- /dev/null +++ b/src/models/jsonld/TaxiStandInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/TaxiVehicleUsageInterface.php b/src/models/jsonld/TaxiVehicleUsageInterface.php new file mode 100644 index 000000000..9ada07493 --- /dev/null +++ b/src/models/jsonld/TaxiVehicleUsageInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'childTaxon' => ['Text', 'Taxon', 'URL'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'hasDefinedTerm' => ['DefinedTerm'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'parentTaxon' => ['URL', 'Taxon', 'Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxonRank' => ['PropertyValue', 'URL', 'Text'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'childTaxon' => 'Closest child taxa of the taxon in question.', + 'description' => 'A description of the item.', + '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.', + 'hasDefinedTerm' => 'A Defined Term contained in this term set.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'parentTaxon' => 'Closest parent taxon of the taxon in question.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxonRank' => 'The taxonomic rank of this taxon given preferably as a URI from a controlled vocabulary – (typically the ranks from TDWG TaxonRank ontology or equivalent Wikidata URIs).', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/TaxonInterface.php b/src/models/jsonld/TaxonInterface.php new file mode 100644 index 000000000..6bf3edaf1 --- /dev/null +++ b/src/models/jsonld/TaxonInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'articleBody' => ['Text'], + 'articleSection' => ['Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'backstory' => ['Text', 'CreativeWork'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'dependencies' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pageEnd' => ['Text', 'Integer'], + 'pageStart' => ['Text', 'Integer'], + 'pagination' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'proficiencyLevel' => ['Text'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'wordCount' => ['Integer'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dependencies', - 'proficiencyLevel' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'dependencies' => ['Text'], - 'proficiencyLevel' => ['Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'articleBody' => 'The actual body of the article.', + 'articleSection' => 'Articles may belong to one or more \'sections\' in a magazine or newspaper, such as Sports, Lifestyle, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'backstory' => 'For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'dependencies' => 'Prerequisites needed to fulfill steps in article.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pageEnd' => 'The page on which the work ends; for example "138" or "xvi".', + 'pageStart' => 'The page on which the work starts; for example "135" or "xiii".', + 'pagination' => 'Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'proficiencyLevel' => 'Proficiency needed for this content; expected values: \'Beginner\', \'Expert\'.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'wordCount' => 'The number of words in the text of the Article.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dependencies' => 'Prerequisites needed to fulfill steps in article.', - 'proficiencyLevel' => 'Proficiency needed for this content; expected values: \'Beginner\', \'Expert\'.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Prerequisites needed to fulfill steps in article. - * - * @var string [schema.org types: Text] - */ - public $dependencies; - /** - * Proficiency needed for this content; expected values: 'Beginner', 'Expert'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $proficiencyLevel; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['author', 'datePublished', 'description', 'headline', 'image', 'name', 'publisher']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['dateModified', 'image', 'mainEntityOfPage', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dependencies', 'proficiencyLevel'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TechArticleInterface.php b/src/models/jsonld/TechArticleInterface.php new file mode 100644 index 000000000..226a20e4e --- /dev/null +++ b/src/models/jsonld/TechArticleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'broadcastChannelId' => ['Text'], + 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], + 'broadcastServiceTier' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'genre' => ['URL', 'Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inBroadcastLineup' => ['CableOrSatelliteService'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'providesBroadcastService' => ['BroadcastService'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'broadcastChannelId', - 'broadcastFrequency', - 'broadcastServiceTier', - 'genre', - 'inBroadcastLineup', - 'providesBroadcastService' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'broadcastChannelId' => ['Text'], - 'broadcastFrequency' => ['BroadcastFrequencySpecification', 'Text'], - 'broadcastServiceTier' => ['Text'], - 'genre' => ['Text', 'URL'], - 'inBroadcastLineup' => ['CableOrSatelliteService'], - 'providesBroadcastService' => ['BroadcastService'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', - 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', - 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', - 'providesBroadcastService' => 'The BroadcastService offered on this channel. Inverse property: hasBroadcastChannel.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The unique address by which the BroadcastService can be identified in a - * provider lineup. In US, this is typically a number. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $broadcastChannelId; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'broadcastChannelId' => 'The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number.', + 'broadcastFrequency' => 'The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM".', + 'broadcastServiceTier' => 'The type of service required to have access to the channel (e.g. Standard or Premium).', + 'description' => 'A description of the item.', + '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.', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inBroadcastLineup' => 'The CableOrSatelliteService offering the channel.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'providesBroadcastService' => 'The BroadcastService offered on this channel.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The frequency used for over-the-air broadcasts. Numeric values or simple - * ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences - * of AM and FM radio channels, e.g. "87 FM". - * - * @var mixed|BroadcastFrequencySpecification|string [schema.org types: BroadcastFrequencySpecification, Text] - */ - public $broadcastFrequency; /** - * The type of service required to have access to the channel (e.g. Standard - * or Premium). - * - * @var string [schema.org types: Text] - */ - public $broadcastServiceTier; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * The CableOrSatelliteService offering the channel. - * - * @var CableOrSatelliteService [schema.org types: CableOrSatelliteService] - */ - public $inBroadcastLineup; - /** - * The BroadcastService offered on this channel. Inverse property: - * hasBroadcastChannel. - * - * @var BroadcastService [schema.org types: BroadcastService] + * @inheritdoc */ - public $providesBroadcastService; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['broadcastChannelId', 'broadcastFrequency', 'broadcastServiceTier', 'genre', 'inBroadcastLineup', 'providesBroadcastService'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TelevisionChannelInterface.php b/src/models/jsonld/TelevisionChannelInterface.php new file mode 100644 index 000000000..ca733ff10 --- /dev/null +++ b/src/models/jsonld/TelevisionChannelInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TelevisionStationInterface.php b/src/models/jsonld/TelevisionStationInterface.php new file mode 100644 index 000000000..4c8e446d5 --- /dev/null +++ b/src/models/jsonld/TelevisionStationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TennisComplexInterface.php b/src/models/jsonld/TennisComplexInterface.php new file mode 100644 index 000000000..463448afe --- /dev/null +++ b/src/models/jsonld/TennisComplexInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TerminatedInterface.php b/src/models/jsonld/TerminatedInterface.php new file mode 100644 index 000000000..f0c9851c0 --- /dev/null +++ b/src/models/jsonld/TerminatedInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TextDigitalDocument.php b/src/models/jsonld/TextDigitalDocument.php index ac4a44777..2c6fd59d6 100644 --- a/src/models/jsonld/TextDigitalDocument.php +++ b/src/models/jsonld/TextDigitalDocument.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'hasDigitalDocumentPermission' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'hasDigitalDocumentPermission' => ['DigitalDocumentPermission'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'hasDigitalDocumentPermission' => 'A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public".' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A permission related to the access to this document (e.g. permission to - * read or write an electronic document). For a public document, specify a - * grantee with an Audience with audienceType equal to "public". - * - * @var DigitalDocumentPermission [schema.org types: DigitalDocumentPermission] + * @inheritdoc */ - public $hasDigitalDocumentPermission; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['hasDigitalDocumentPermission'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TextDigitalDocumentInterface.php b/src/models/jsonld/TextDigitalDocumentInterface.php new file mode 100644 index 000000000..5ab7f2589 --- /dev/null +++ b/src/models/jsonld/TextDigitalDocumentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TheaterEventInterface.php b/src/models/jsonld/TheaterEventInterface.php new file mode 100644 index 000000000..5f644ab23 --- /dev/null +++ b/src/models/jsonld/TheaterEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person. Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place. The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions. Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard. Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand). A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain. The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number. The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. Points-of-Sales - * operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. The number of interactions for the CreativeWork using the - * WebSite or SoftwareApplication. The most specific child type of - * InteractionCounter should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. The International Standard of Industrial Classification - * of All Economic Activities (ISIC), Revision 4 code for a particular - * organization, business person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. Of a Person, and - * less typically of an Organization, to indicate a topic that is known about - * - suggesting possible expertise but not implying it. We do not distinguish - * skill levels here, or relate this to educational content, events, - * objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. Of a Person, and less typically of an Organization, to - * indicate a known language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). A pointer to products or services sought by the organization or - * person (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. The Tax / Fiscal ID of the organization or person, - * e.g. the TIN in the US or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TheaterGroupInterface.php b/src/models/jsonld/TheaterGroupInterface.php new file mode 100644 index 000000000..3a29b0e1e --- /dev/null +++ b/src/models/jsonld/TheaterGroupInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TherapeuticInterface.php b/src/models/jsonld/TherapeuticInterface.php new file mode 100644 index 000000000..4d6d3b785 --- /dev/null +++ b/src/models/jsonld/TherapeuticInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'adverseOutcome' => ['MedicalEntity'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'doseSchedule' => ['DoseSchedule'], + 'drug' => ['Drug'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'adverseOutcome', - 'doseSchedule', - 'drug' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'adverseOutcome' => ['MedicalEntity'], - 'doseSchedule' => ['DoseSchedule'], - 'drug' => ['Drug'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', - 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', - 'drug' => 'Specifying a drug or medicine used in a medication procedure' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'adverseOutcome' => 'A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A possible complication and/or side effect of this therapy. If it is known - * that an adverse outcome is serious (resulting in death, disability, or - * permanent damage; requiring hospitalization; or is otherwise - * life-threatening or requires immediate medical attention), tag it as a - * seriouseAdverseOutcome instead. - * - * @var MedicalEntity [schema.org types: MedicalEntity] - */ - public $adverseOutcome; - /** - * A dosing schedule for the drug for a given population, either observed, - * recommended, or maximum dose based on the type used. - * - * @var DoseSchedule [schema.org types: DoseSchedule] - */ - public $doseSchedule; /** - * Specifying a drug or medicine used in a medication procedure - * - * @var Drug [schema.org types: Drug] + * @inheritdoc */ - public $drug; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['adverseOutcome', 'doseSchedule', 'drug'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TherapeuticProcedureInterface.php b/src/models/jsonld/TherapeuticProcedureInterface.php new file mode 100644 index 000000000..80963305b --- /dev/null +++ b/src/models/jsonld/TherapeuticProcedureInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'inSupportOf' => ['Text'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'inSupportOf' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'inSupportOf' => 'Qualification, candidature, degree, application that Thesis supports.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'inSupportOf' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'inSupportOf' => 'Qualification, candidature, degree, application that Thesis supports.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Qualification, candidature, degree, application that Thesis supports. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $inSupportOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['inSupportOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ThesisInterface.php b/src/models/jsonld/ThesisInterface.php new file mode 100644 index 000000000..2467a4cfe --- /dev/null +++ b/src/models/jsonld/ThesisInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing.. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - 'name', - 'description' - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - 'url', - 'image' - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var mixed|string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var mixed|Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var mixed|string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing.. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var mixed|string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ThingInterface.php b/src/models/jsonld/ThingInterface.php new file mode 100644 index 000000000..1ab7b41b4 --- /dev/null +++ b/src/models/jsonld/ThingInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'followup' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'howPerformed' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'preparation' => ['MedicalEntity', 'Text'], + 'procedureType' => ['MedicalProcedureType'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'followup' => 'Typical or recommended followup care after the procedure is performed.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + 'howPerformed' => 'How the procedure is performed.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'preparation' => 'Typical preparation that a patient must undergo before having the procedure performed.', + 'procedureType' => 'The type of procedure, for example Surgical, Noninvasive, or Percutaneous.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ThroatInterface.php b/src/models/jsonld/ThroatInterface.php new file mode 100644 index 000000000..d57c16a73 --- /dev/null +++ b/src/models/jsonld/ThroatInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ThursdayInterface.php b/src/models/jsonld/ThursdayInterface.php new file mode 100644 index 000000000..a02b437bb --- /dev/null +++ b/src/models/jsonld/ThursdayInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'dateIssued' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'issuedBy' => ['Organization'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'ticketNumber' => ['Text'], + 'ticketToken' => ['URL', 'Text'], + 'ticketedSeat' => ['Seat'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'dateIssued', - 'issuedBy', - 'priceCurrency', - 'ticketNumber', - 'ticketToken', - 'ticketedSeat', - 'totalPrice', - 'underName' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'dateIssued' => ['Date', 'DateTime'], - 'issuedBy' => ['Organization'], - 'priceCurrency' => ['Text'], - 'ticketNumber' => ['Text'], - 'ticketToken' => ['Text', 'URL'], - 'ticketedSeat' => ['Seat'], - 'totalPrice' => ['Number', 'PriceSpecification', 'Text'], - 'underName' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'dateIssued' => 'The date the ticket was issued.', - 'issuedBy' => 'The organization issuing the ticket or permit.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'ticketNumber' => 'The unique identifier for the ticket.', - 'ticketToken' => 'Reference to an asset (e.g., Barcode, QR code image or PDF) usable for entrance.', - 'ticketedSeat' => 'The seat associated with the ticket.', - '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 similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'underName' => 'The person or organization the reservation or ticket is for.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The date the ticket was issued. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateIssued; - /** - * The organization issuing the ticket or permit. - * - * @var Organization [schema.org types: Organization] - */ - public $issuedBy; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceCurrency; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'dateIssued' => 'The date the ticket was issued.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'issuedBy' => 'The organization issuing the ticket or permit.', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'ticketNumber' => 'The unique identifier for the ticket.', + 'ticketToken' => 'Reference to an asset (e.g., Barcode, QR code image or PDF) usable for entrance.', + 'ticketedSeat' => 'The seat associated with the ticket.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The unique identifier for the ticket. - * - * @var string [schema.org types: Text] - */ - public $ticketNumber; - /** - * Reference to an asset (e.g., Barcode, QR code image or PDF) usable for - * entrance. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $ticketToken; - /** - * The seat associated with the ticket. - * - * @var Seat [schema.org types: Seat] - */ - public $ticketedSeat; /** - * 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 similiar - * Unicode symbols. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to - * indicate a decimal point. Avoid using these symbols as a readability - * separator. - * - * @var mixed|float|PriceSpecification|string [schema.org types: Number, PriceSpecification, Text] - */ - public $totalPrice; - /** - * The person or organization the reservation or ticket is for. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $underName; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['dateIssued', 'issuedBy', 'priceCurrency', 'ticketNumber', 'ticketToken', 'ticketedSeat', 'totalPrice', 'underName'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TicketInterface.php b/src/models/jsonld/TicketInterface.php new file mode 100644 index 000000000..91beba73e --- /dev/null +++ b/src/models/jsonld/TicketInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TieActionInterface.php b/src/models/jsonld/TieActionInterface.php new file mode 100644 index 000000000..a8d3ae594 --- /dev/null +++ b/src/models/jsonld/TieActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TimeInterface.php b/src/models/jsonld/TimeInterface.php new file mode 100644 index 000000000..2731bcde1 --- /dev/null +++ b/src/models/jsonld/TimeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'recipient' => ['Person', 'Audience', 'ContactPoint', 'Organization'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'recipient' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'recipient' => ['Audience', 'ContactPoint', 'Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'recipient' => 'A sub property of participant. The participant who is at the receiving end of the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The participant who is at the receiving end - * of the action. - * - * @var mixed|Audience|ContactPoint|Organization|Person [schema.org types: Audience, ContactPoint, Organization, Person] + * @inheritdoc */ - public $recipient; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['recipient'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TipActionInterface.php b/src/models/jsonld/TipActionInterface.php new file mode 100644 index 000000000..ba77ec4bd --- /dev/null +++ b/src/models/jsonld/TipActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TireShopInterface.php b/src/models/jsonld/TireShopInterface.php new file mode 100644 index 000000000..fe851e661 --- /dev/null +++ b/src/models/jsonld/TireShopInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/TobaccoNicotineConsiderationInterface.php b/src/models/jsonld/TobaccoNicotineConsiderationInterface.php new file mode 100644 index 000000000..c2a4da60d --- /dev/null +++ b/src/models/jsonld/TobaccoNicotineConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TollFreeInterface.php b/src/models/jsonld/TollFreeInterface.php new file mode 100644 index 000000000..56cc39c52 --- /dev/null +++ b/src/models/jsonld/TollFreeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'availableLanguage' => ['Text', 'Language'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'touristType' => ['Audience', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'availableLanguage', - 'touristType' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'availableLanguage' => ['Language', 'Text'], - 'touristType' => ['Audience', 'Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]]', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'touristType' => 'Attraction suitable for type(s) of tourist. eg. Children, visitors from a particular country, etc. ', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'availableLanguage' => 'A language someone may use with or at the item, service or place. Please use one of the language codes from the IETF BCP 47 standard. See also inLanguage', - 'touristType' => 'Attraction suitable for type(s) of tourist. eg. Children, visitors from a particular country, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A language someone may use with or at the item, service or place. Please - * use one of the language codes from the IETF BCP 47 standard. See also - * inLanguage - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $availableLanguage; - /** - * Attraction suitable for type(s) of tourist. eg. Children, visitors from a - * particular country, etc. - * - * @var mixed|Audience|string [schema.org types: Audience, Text] + * @inheritdoc */ - public $touristType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['availableLanguage', 'touristType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TouristAttractionInterface.php b/src/models/jsonld/TouristAttractionInterface.php new file mode 100644 index 000000000..70d888815 --- /dev/null +++ b/src/models/jsonld/TouristAttractionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'includesAttraction' => ['TouristAttraction'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'touristType' => ['Audience', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'includesAttraction', - 'touristType' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'includesAttraction' => ['TouristAttraction'], - 'touristType' => ['Audience', 'Text'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'includesAttraction' => 'Attraction located at destination.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'touristType' => 'Attraction suitable for type(s) of tourist. eg. Children, visitors from a particular country, etc. ', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'includesAttraction' => 'Attraction located at destination.', - 'touristType' => 'Attraction suitable for type(s) of tourist. eg. Children, visitors from a particular country, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Attraction located at destination. - * - * @var TouristAttraction [schema.org types: TouristAttraction] - */ - public $includesAttraction; - /** - * Attraction suitable for type(s) of tourist. eg. Children, visitors from a - * particular country, etc. - * - * @var mixed|Audience|string [schema.org types: Audience, Text] + * @inheritdoc */ - public $touristType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['includesAttraction', 'touristType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TouristDestinationInterface.php b/src/models/jsonld/TouristDestinationInterface.php new file mode 100644 index 000000000..f60fe9c42 --- /dev/null +++ b/src/models/jsonld/TouristDestinationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TouristInformationCenterInterface.php b/src/models/jsonld/TouristInformationCenterInterface.php new file mode 100644 index 000000000..603389e31 --- /dev/null +++ b/src/models/jsonld/TouristInformationCenterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'arrivalTime' => ['Time', 'DateTime'], + 'departureTime' => ['Time', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itinerary' => ['ItemList', 'Place'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfTrip' => ['Trip'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'sameAs' => ['URL'], + 'subTrip' => ['Trip'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'touristType' => ['Audience', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'touristType' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'arrivalTime' => 'The expected arrival time.', + 'departureTime' => 'The expected departure time.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itinerary' => 'Destination(s) ( [[Place]] ) that make up a trip. For a trip where destination order is important use [[ItemList]] to specify that order (see examples).', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'partOfTrip' => 'Identifies that this [[Trip]] is a subTrip of another Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + '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.', + 'subTrip' => 'Identifies a [[Trip]] that is a subTrip of this Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'touristType' => 'Attraction suitable for type(s) of tourist. eg. Children, visitors from a particular country, etc. ', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'touristType' => ['Audience', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'touristType' => 'Attraction suitable for type(s) of tourist. eg. Children, visitors from a particular country, etc.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Attraction suitable for type(s) of tourist. eg. Children, visitors from a - * particular country, etc. - * - * @var mixed|Audience|string [schema.org types: Audience, Text] + * @inheritdoc */ - public $touristType; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['touristType'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TouristTripInterface.php b/src/models/jsonld/TouristTripInterface.php new file mode 100644 index 000000000..799a9877f --- /dev/null +++ b/src/models/jsonld/TouristTripInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ToxicologicInterface.php b/src/models/jsonld/ToxicologicInterface.php new file mode 100644 index 000000000..25ab2376d --- /dev/null +++ b/src/models/jsonld/ToxicologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ToyStoreInterface.php b/src/models/jsonld/ToyStoreInterface.php new file mode 100644 index 000000000..249503772 --- /dev/null +++ b/src/models/jsonld/ToyStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'deliveryMethod' => ['DeliveryMethod'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'deliveryMethod' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'deliveryMethod' => 'A sub property of instrument. The method of delivery.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'deliveryMethod' => ['DeliveryMethod'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'deliveryMethod' => 'A sub property of instrument. The method of delivery.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of instrument. The method of delivery. - * - * @var DeliveryMethod [schema.org types: DeliveryMethod] + * @inheritdoc */ - public $deliveryMethod; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['deliveryMethod'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TrackActionInterface.php b/src/models/jsonld/TrackActionInterface.php new file mode 100644 index 000000000..1a73b1544 --- /dev/null +++ b/src/models/jsonld/TrackActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceCurrency' => ['Text'], + 'priceSpecification' => ['PriceSpecification'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'price', - 'priceCurrency', - 'priceSpecification' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'price' => ['Number', 'Text'], - 'priceCurrency' => ['Text'], - 'priceSpecification' => ['PriceSpecification'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: Use the priceCurrency property (with standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR") instead of including ambiguous symbols such as \'$\' in the value. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceSpecification' => 'One or more detailed price specifications, indicating the unit price and delivery or payment charges.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The offer price of a product, or of a price component when attached to - * PriceSpecification and its subtypes. Usage guidelines: Use the - * priceCurrency property (with standard formats: ISO 4217 currency format - * e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names - * for Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR") instead of including ambiguous symbols such as '$' in the - * value. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a - * decimal point. Avoid using these symbols as a readability separator. Note - * that both RDFa and Microdata syntax allow the use of a "content=" attribute - * for publishing simple machine-readable values alongside more human-friendly - * formatting. Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to - * 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $price; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; /** - * One or more detailed price specifications, indicating the unit price and - * delivery or payment charges. - * - * @var PriceSpecification [schema.org types: PriceSpecification] + * @inheritdoc */ - public $priceSpecification; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['price', 'priceCurrency', 'priceSpecification'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TradeActionInterface.php b/src/models/jsonld/TradeActionInterface.php new file mode 100644 index 000000000..7aa15b1f6 --- /dev/null +++ b/src/models/jsonld/TradeActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TraditionalChineseInterface.php b/src/models/jsonld/TraditionalChineseInterface.php new file mode 100644 index 000000000..3f5d9f451 --- /dev/null +++ b/src/models/jsonld/TraditionalChineseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'bookingAgent' => ['Person', 'Organization'], + 'bookingTime' => ['DateTime'], + 'broker' => ['Person', 'Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'modifiedTime' => ['DateTime'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'priceCurrency' => ['Text'], + 'programMembershipUsed' => ['ProgramMembership'], + 'provider' => ['Organization', 'Person'], + 'reservationFor' => ['Thing'], + 'reservationId' => ['Text'], + 'reservationStatus' => ['ReservationStatusType'], + 'reservedTicket' => ['Ticket'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'totalPrice' => ['PriceSpecification', 'Number', 'Text'], + 'underName' => ['Organization', 'Person'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'bookingTime', - 'broker', - 'modifiedTime', - 'priceCurrency', - 'programMembershipUsed', - 'provider', - 'reservationFor', - 'reservationId', - 'reservationStatus', - 'reservedTicket', - 'totalPrice', - 'underName' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'bookingTime' => ['DateTime'], - 'broker' => ['Organization', 'Person'], - 'modifiedTime' => ['DateTime'], - 'priceCurrency' => ['Text'], - 'programMembershipUsed' => ['ProgramMembership'], - 'provider' => ['Organization', 'Person'], - 'reservationFor' => ['Thing'], - 'reservationId' => ['Text'], - 'reservationStatus' => ['ReservationStatusType'], - 'reservedTicket' => ['Ticket'], - 'totalPrice' => ['Number', 'PriceSpecification', 'Text'], - 'underName' => ['Organization', 'Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'bookingTime' => 'The date and time the reservation was booked.', - '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. Supersedes bookingAgent.', - 'modifiedTime' => 'The date and time the reservation was modified.', - 'priceCurrency' => 'The currency of the price, or a price component when attached to PriceSpecification and its subtypes. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', - '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. Supersedes carrier.', - 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', - 'reservationId' => 'A unique identifier for the reservation.', - 'reservationStatus' => 'The current status of the reservation.', - 'reservedTicket' => 'A ticket associated with the reservation.', - '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 similiar Unicode symbols. Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', - 'underName' => 'The person or organization the reservation or ticket is for.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The date and time the reservation was booked. - * - * @var DateTime [schema.org types: DateTime] - */ - public $bookingTime; /** - * 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. Supersedes - * bookingAgent. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $broker; - /** - * The date and time the reservation was modified. - * - * @var DateTime [schema.org types: DateTime] - */ - public $modifiedTime; - /** - * The currency of the price, or a price component when attached to - * PriceSpecification and its subtypes. Use standard formats: ISO 4217 - * currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; - * well known names for Local Exchange Tradings Systems (LETS) and other - * currency types e.g. "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $priceCurrency; - /** - * Any membership in a frequent flyer, hotel loyalty program, etc. being - * applied to the reservation. - * - * @var ProgramMembership [schema.org types: ProgramMembership] - */ - public $programMembershipUsed; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * The thing -- flight, event, restaurant,etc. being reserved. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $reservationFor; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', + 'bookingTime' => 'The date and time the reservation was booked.', + '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.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'modifiedTime' => 'The date and time the reservation was modified.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', + '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.', + 'reservationFor' => 'The thing -- flight, event, restaurant,etc. being reserved.', + 'reservationId' => 'A unique identifier for the reservation.', + 'reservationStatus' => 'The current status of the reservation.', + 'reservedTicket' => 'A ticket associated with the reservation.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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 similiar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', + 'underName' => 'The person or organization the reservation or ticket is for.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A unique identifier for the reservation. - * - * @var string [schema.org types: Text] - */ - public $reservationId; - /** - * The current status of the reservation. - * - * @var ReservationStatusType [schema.org types: ReservationStatusType] - */ - public $reservationStatus; - /** - * A ticket associated with the reservation. - * - * @var Ticket [schema.org types: Ticket] - */ - public $reservedTicket; - /** - * 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 similiar - * Unicode symbols. Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to - * indicate a decimal point. Avoid using these symbols as a readability - * separator. - * - * @var mixed|float|PriceSpecification|string [schema.org types: Number, PriceSpecification, Text] - */ - public $totalPrice; /** - * The person or organization the reservation or ticket is for. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $underName; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['bookingTime', 'broker', 'modifiedTime', 'priceCurrency', 'programMembershipUsed', 'provider', 'reservationFor', 'reservationId', 'reservationStatus', 'reservedTicket', 'totalPrice', 'underName'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TrainReservationInterface.php b/src/models/jsonld/TrainReservationInterface.php new file mode 100644 index 000000000..5f95711e0 --- /dev/null +++ b/src/models/jsonld/TrainReservationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TrainStationInterface.php b/src/models/jsonld/TrainStationInterface.php new file mode 100644 index 000000000..1f9b72bf9 --- /dev/null +++ b/src/models/jsonld/TrainStationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'arrivalPlatform' => ['Text'], + 'arrivalStation' => ['TrainStation'], + 'arrivalTime' => ['Time', 'DateTime'], + 'departurePlatform' => ['Text'], + 'departureStation' => ['TrainStation'], + 'departureTime' => ['Time', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itinerary' => ['ItemList', 'Place'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfTrip' => ['Trip'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'sameAs' => ['URL'], + 'subTrip' => ['Trip'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'trainName' => ['Text'], + 'trainNumber' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'arrivalPlatform', - 'arrivalStation', - 'departurePlatform', - 'departureStation', - 'trainName', - 'trainNumber' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'arrivalPlatform' => ['Text'], - 'arrivalStation' => ['TrainStation'], - 'departurePlatform' => ['Text'], - 'departureStation' => ['TrainStation'], - 'trainName' => ['Text'], - 'trainNumber' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'arrivalPlatform' => 'The platform where the train arrives.', - 'arrivalStation' => 'The station where the train trip ends.', - 'departurePlatform' => 'The platform from which the train departs.', - 'departureStation' => 'The station from which the train departs.', - 'trainName' => 'The name of the train (e.g. The Orient Express).', - 'trainNumber' => 'The unique identifier for the train.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * The platform where the train arrives. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $arrivalPlatform; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'arrivalPlatform' => 'The platform where the train arrives.', + 'arrivalStation' => 'The station where the train trip ends.', + 'arrivalTime' => 'The expected arrival time.', + 'departurePlatform' => 'The platform from which the train departs.', + 'departureStation' => 'The station from which the train departs.', + 'departureTime' => 'The expected departure time.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itinerary' => 'Destination(s) ( [[Place]] ) that make up a trip. For a trip where destination order is important use [[ItemList]] to specify that order (see examples).', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'partOfTrip' => 'Identifies that this [[Trip]] is a subTrip of another Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + '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.', + 'subTrip' => 'Identifies a [[Trip]] that is a subTrip of this Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'trainName' => 'The name of the train (e.g. The Orient Express).', + 'trainNumber' => 'The unique identifier for the train.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The station where the train trip ends. - * - * @var TrainStation [schema.org types: TrainStation] - */ - public $arrivalStation; /** - * The platform from which the train departs. - * - * @var string [schema.org types: Text] - */ - public $departurePlatform; - /** - * The station from which the train departs. - * - * @var TrainStation [schema.org types: TrainStation] - */ - public $departureStation; - /** - * The name of the train (e.g. The Orient Express). - * - * @var string [schema.org types: Text] - */ - public $trainName; - /** - * The unique identifier for the train. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $trainNumber; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['arrivalPlatform', 'arrivalStation', 'departurePlatform', 'departureStation', 'trainName', 'trainNumber'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TrainTripInterface.php b/src/models/jsonld/TrainTripInterface.php new file mode 100644 index 000000000..8e8974e41 --- /dev/null +++ b/src/models/jsonld/TrainTripInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'fromLocation', - 'toLocation' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'fromLocation' => ['Place'], - 'toLocation' => ['Place'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', - 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of location. The original location of the object or the - * agent before the action. - * - * @var Place [schema.org types: Place] - */ - public $fromLocation; - /** - * A sub property of location. The final location of the object or the agent - * after the action. - * - * @var Place [schema.org types: Place] + * @inheritdoc */ - public $toLocation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['fromLocation', 'toLocation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TransferActionInterface.php b/src/models/jsonld/TransferActionInterface.php new file mode 100644 index 000000000..89648e5b1 --- /dev/null +++ b/src/models/jsonld/TransferActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/TransformedContentInterface.php b/src/models/jsonld/TransformedContentInterface.php new file mode 100644 index 000000000..d0defd362 --- /dev/null +++ b/src/models/jsonld/TransformedContentInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TransitMapInterface.php b/src/models/jsonld/TransitMapInterface.php new file mode 100644 index 000000000..99a27a623 --- /dev/null +++ b/src/models/jsonld/TransitMapInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'distance' => ['Distance'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'fromLocation' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'toLocation' => ['Place'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'distance' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'distance' => 'The distance travelled, e.g. exercising or travelling.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'fromLocation' => 'A sub property of location. The original location of the object or the agent before the action.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'toLocation' => 'A sub property of location. The final location of the object or the agent after the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'distance' => ['Distance'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'distance' => 'The distance travelled, e.g. exercising or travelling.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The distance travelled, e.g. exercising or travelling. - * - * @var Distance [schema.org types: Distance] + * @inheritdoc */ - public $distance; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['distance'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TravelActionInterface.php b/src/models/jsonld/TravelActionInterface.php new file mode 100644 index 000000000..2ebecfc43 --- /dev/null +++ b/src/models/jsonld/TravelActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TravelAgencyInterface.php b/src/models/jsonld/TravelAgencyInterface.php new file mode 100644 index 000000000..61eb92eb0 --- /dev/null +++ b/src/models/jsonld/TravelAgencyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'code', - 'guideline', - 'legalStatus', - 'medicineSystem', - 'recognizingAuthority', - 'relevantSpecialty', - 'study' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'code' => ['MedicalCode'], - 'guideline' => ['MedicalGuideline'], - 'legalStatus' => ['DrugLegalStatus', 'MedicalEnumeration', 'Text'], - 'medicineSystem' => ['MedicineSystem'], - 'recognizingAuthority' => ['Organization'], - 'relevantSpecialty' => ['MedicalSpecialty'], - 'study' => ['MedicalStudy'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', - 'guideline' => 'A medical guideline related to this entity.', - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', - 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', - 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', - 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', - 'study' => 'A medical study or trial related to this entity.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A medical code for the entity, taken from a controlled vocabulary or - * ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. - * - * @var MedicalCode [schema.org types: MedicalCode] - */ - public $code; - /** - * A medical guideline related to this entity. - * - * @var MedicalGuideline [schema.org types: MedicalGuideline] + * @inheritdoc */ - public $guideline; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The drug or supplement's legal status, including any controlled substance - * schedules that apply. - * - * @var mixed|DrugLegalStatus|MedicalEnumeration|string [schema.org types: DrugLegalStatus, MedicalEnumeration, Text] - */ - public $legalStatus; - /** - * The system of medicine that includes this MedicalEntity, for example - * 'evidence-based', 'homeopathic', 'chiropractic', etc. - * - * @var MedicineSystem [schema.org types: MedicineSystem] - */ - public $medicineSystem; - /** - * If applicable, the organization that officially recognizes this entity as - * part of its endorsed system of medicine. - * - * @var Organization [schema.org types: Organization] - */ - public $recognizingAuthority; - /** - * If applicable, a medical specialty in which this entity is relevant. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] - */ - public $relevantSpecialty; /** - * A medical study or trial related to this entity. - * - * @var MedicalStudy [schema.org types: MedicalStudy] + * @inheritdoc */ - public $study; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['code', 'guideline', 'legalStatus', 'medicineSystem', 'recognizingAuthority', 'relevantSpecialty', 'study'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TreatmentIndicationInterface.php b/src/models/jsonld/TreatmentIndicationInterface.php new file mode 100644 index 000000000..199746ddb --- /dev/null +++ b/src/models/jsonld/TreatmentIndicationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TreatmentsHealthAspectInterface.php b/src/models/jsonld/TreatmentsHealthAspectInterface.php new file mode 100644 index 000000000..3d5a3ddaa --- /dev/null +++ b/src/models/jsonld/TreatmentsHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'arrivalTime' => ['Time', 'DateTime'], + 'departureTime' => ['Time', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'itinerary' => ['ItemList', 'Place'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfTrip' => ['Trip'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'sameAs' => ['URL'], + 'subTrip' => ['Trip'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'arrivalTime', - 'departureTime', - 'itinerary', - 'offers', - 'partOfTrip', - 'provider', - 'subTrip' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'arrivalTime' => ['DateTime', 'Time'], - 'departureTime' => ['DateTime', 'Time'], - 'itinerary' => ['ItemList', 'Place'], - 'offers' => ['Demand', 'Offer'], - 'partOfTrip' => ['Trip'], - 'provider' => ['Organization', 'Person'], - 'subTrip' => ['Trip'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'arrivalTime' => 'The expected arrival time.', - 'departureTime' => 'The expected departure time.', - 'itinerary' => 'Destination(s) ( Place ) that make up a trip. For a trip where destination order is important use ItemList to specify that order (see examples).', - '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. Inverse property: itemOffered.', - 'partOfTrip' => 'Identifies that this Trip is a subTrip of another Trip. For example Day 1, Day 2, etc. of a multi-day trip. Inverse property: subTrip.', - '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. Supersedes carrier.', - 'subTrip' => 'Identifies a Trip that is a subTrip of this Trip. For example Day 1, Day 2, etc. of a multi-day trip. Inverse property: partOfTrip.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The expected arrival time. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $arrivalTime; - /** - * The expected departure time. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] + * @inheritdoc */ - public $departureTime; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'arrivalTime' => 'The expected arrival time.', + 'departureTime' => 'The expected departure time.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'itinerary' => 'Destination(s) ( [[Place]] ) that make up a trip. For a trip where destination order is important use [[ItemList]] to specify that order (see examples).', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'partOfTrip' => 'Identifies that this [[Trip]] is a subTrip of another Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + '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.', + 'subTrip' => 'Identifies a [[Trip]] that is a subTrip of this Trip. For example Day 1, Day 2, etc. of a multi-day trip.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * Destination(s) ( Place ) that make up a trip. For a trip where destination - * order is important use ItemList to specify that order (see examples). - * - * @var mixed|ItemList|Place [schema.org types: ItemList, Place] - */ - public $itinerary; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; /** - * Identifies that this Trip is a subTrip of another Trip. For example Day 1, - * Day 2, etc. of a multi-day trip. Inverse property: subTrip. - * - * @var Trip [schema.org types: Trip] - */ - public $partOfTrip; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * Identifies a Trip that is a subTrip of this Trip. For example Day 1, Day 2, - * etc. of a multi-day trip. Inverse property: partOfTrip. - * - * @var Trip [schema.org types: Trip] + * @inheritdoc */ - public $subTrip; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['arrivalTime', 'departureTime', 'itinerary', 'offers', 'partOfTrip', 'provider', 'subTrip'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TripInterface.php b/src/models/jsonld/TripInterface.php new file mode 100644 index 000000000..117605db4 --- /dev/null +++ b/src/models/jsonld/TripInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TripleBlindedTrialInterface.php b/src/models/jsonld/TripleBlindedTrialInterface.php new file mode 100644 index 000000000..e47ca3c64 --- /dev/null +++ b/src/models/jsonld/TripleBlindedTrialInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return []; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return []; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/TrueInterface.php b/src/models/jsonld/TrueInterface.php new file mode 100644 index 000000000..ce3cd256e --- /dev/null +++ b/src/models/jsonld/TrueInterface.php @@ -0,0 +1,24 @@ + ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] - ]); - - return $rules; - } -} diff --git a/src/models/jsonld/Tuesday.php b/src/models/jsonld/Tuesday.php index 4504ce0d2..62c962c97 100644 --- a/src/models/jsonld/Tuesday.php +++ b/src/models/jsonld/Tuesday.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TuesdayInterface.php b/src/models/jsonld/TuesdayInterface.php new file mode 100644 index 000000000..57afd03c1 --- /dev/null +++ b/src/models/jsonld/TuesdayInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'amountOfThisGood' => ['Number'], + 'businessFunction' => ['BusinessFunction'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'typeOfGood' => ['Product', 'Service'], + 'unitCode' => ['Text', 'URL'], + 'unitText' => ['Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'amountOfThisGood', - 'businessFunction', - 'typeOfGood', - 'unitCode', - 'unitText' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'amountOfThisGood' => ['Number'], - 'businessFunction' => ['BusinessFunction'], - 'typeOfGood' => ['Product', 'Service'], - 'unitCode' => ['Text', 'URL'], - 'unitText' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'amountOfThisGood' => 'The quantity of the goods included in the offer.', - 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', - 'typeOfGood' => 'The product that this structured value is referring to.', - 'unitCode' => 'The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.', - 'unitText' => 'A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'amountOfThisGood' => 'The quantity of the goods included in the offer.', + 'businessFunction' => 'The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'typeOfGood' => 'The product that this structured value is referring to.', + 'unitCode' => 'The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.', + 'unitText' => 'A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The quantity of the goods included in the offer. - * - * @var float [schema.org types: Number] - */ - public $amountOfThisGood; - /** - * The business function (e.g. sell, lease, repair, dispose) of the offer or - * component of a bundle (TypeAndQuantityNode). The default is - * http://purl.org/goodrelations/v1#Sell. - * - * @var BusinessFunction [schema.org types: BusinessFunction] - */ - public $businessFunction; - /** - * The product that this structured value is referring to. - * - * @var mixed|Product|Service [schema.org types: Product, Service] - */ - public $typeOfGood; - /** - * The unit of measurement given using the UN/CEFACT Common Code (3 - * characters) or a URL. Other codes than the UN/CEFACT Common Code may be - * used with a prefix followed by a colon. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $unitCode; - /** - * A string or text indicating the unit of measurement. Useful if you cannot - * provide a standard unit code for unitCode. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $unitText; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['amountOfThisGood', 'businessFunction', 'typeOfGood', 'unitCode', 'unitText'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TypeAndQuantityNodeInterface.php b/src/models/jsonld/TypeAndQuantityNodeInterface.php new file mode 100644 index 000000000..db31d4e32 --- /dev/null +++ b/src/models/jsonld/TypeAndQuantityNodeInterface.php @@ -0,0 +1,24 @@ +unitCode. + * + * @var string|Text + */ + public $unitText; + + /** + * The business function (e.g. sell, lease, repair, dispose) of the offer or + * component of a bundle (TypeAndQuantityNode). The default is + * http://purl.org/goodrelations/v1#Sell. + * + * @var BusinessFunction + */ + public $businessFunction; + + /** + * The product that this structured value is referring to. + * + * @var Product|Service + */ + public $typeOfGood; + + /** + * The quantity of the goods included in the offer. + * + * @var float|Number + */ + public $amountOfThisGood; + + /** + * The unit of measurement given using the UN/CEFACT Common Code (3 + * characters) or a URL. Other codes than the UN/CEFACT Common Code may be + * used with a prefix followed by a colon. + * + * @var string|Text|URL + */ + public $unitCode; + +} diff --git a/src/models/jsonld/TypesHealthAspect.php b/src/models/jsonld/TypesHealthAspect.php index 5f13d7635..ca5ab4531 100644 --- a/src/models/jsonld/TypesHealthAspect.php +++ b/src/models/jsonld/TypesHealthAspect.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/TypesHealthAspectInterface.php b/src/models/jsonld/TypesHealthAspectInterface.php new file mode 100644 index 000000000..e0dcb973d --- /dev/null +++ b/src/models/jsonld/TypesHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UKNonprofitTypeInterface.php b/src/models/jsonld/UKNonprofitTypeInterface.php new file mode 100644 index 000000000..20ef9a81e --- /dev/null +++ b/src/models/jsonld/UKNonprofitTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UKTrustInterface.php b/src/models/jsonld/UKTrustInterface.php new file mode 100644 index 000000000..b04dd7199 --- /dev/null +++ b/src/models/jsonld/UKTrustInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static public $googleRecommendedSchema = []; + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'category' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'category' => ['PhysicalActivityCategory', 'Text', 'Thing'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; /** - * A category for the item. Greater signs or slashes can be used to informally - * indicate a category hierarchy. - * - * @var mixed|PhysicalActivityCategory|string|Thing [schema.org types: PhysicalActivityCategory, Text, Thing] + * @inheritdoc */ - public $category; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['category'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/URLInterface.php b/src/models/jsonld/URLInterface.php new file mode 100644 index 000000000..9d3655b5f --- /dev/null +++ b/src/models/jsonld/URLInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/USNonprofitTypeInterface.php b/src/models/jsonld/USNonprofitTypeInterface.php new file mode 100644 index 000000000..7154ad0b3 --- /dev/null +++ b/src/models/jsonld/USNonprofitTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UltrasoundInterface.php b/src/models/jsonld/UltrasoundInterface.php new file mode 100644 index 000000000..35f104d1c --- /dev/null +++ b/src/models/jsonld/UltrasoundInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UnRegisterActionInterface.php b/src/models/jsonld/UnRegisterActionInterface.php new file mode 100644 index 000000000..3a47fda0e --- /dev/null +++ b/src/models/jsonld/UnRegisterActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UnclassifiedAdultConsiderationInterface.php b/src/models/jsonld/UnclassifiedAdultConsiderationInterface.php new file mode 100644 index 000000000..4914312ce --- /dev/null +++ b/src/models/jsonld/UnclassifiedAdultConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UnemploymentSupportInterface.php b/src/models/jsonld/UnemploymentSupportInterface.php new file mode 100644 index 000000000..e7e9f07a1 --- /dev/null +++ b/src/models/jsonld/UnemploymentSupportInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UnincorporatedAssociationCharityInterface.php b/src/models/jsonld/UnincorporatedAssociationCharityInterface.php new file mode 100644 index 000000000..2527da1a7 --- /dev/null +++ b/src/models/jsonld/UnincorporatedAssociationCharityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'billingDuration' => ['Duration', 'QuantitativeValue', 'Number'], + 'billingIncrement' => ['Number'], + 'billingStart' => ['Number'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'eligibleQuantity' => ['QuantitativeValue'], + 'eligibleTransactionVolume' => ['PriceSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maxPrice' => ['Number'], + 'minPrice' => ['Number'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'price' => ['Number', 'Text'], + 'priceComponentType' => ['PriceComponentTypeEnumeration'], + 'priceCurrency' => ['Text'], + 'priceType' => ['PriceTypeEnumeration', 'Text'], + 'referenceQuantity' => ['QuantitativeValue'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'unitCode' => ['Text', 'URL'], + 'unitText' => ['Text'], + 'url' => ['URL'], + 'validFrom' => ['DateTime', 'Date'], + 'validThrough' => ['DateTime', 'Date'], + 'valueAddedTaxIncluded' => ['Boolean'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'billingIncrement', - 'priceType', - 'referenceQuantity', - 'unitCode', - 'unitText' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'billingIncrement' => ['Number'], - 'priceType' => ['Text'], - 'referenceQuantity' => ['QuantitativeValue'], - 'unitCode' => ['Text', 'URL'], - 'unitText' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'billingIncrement' => 'This property specifies the minimal quantity and rounding increment that will be the basis for the billing. The unit of measurement is specified by the unitCode property.', - 'priceType' => 'A short text or acronym indicating multiple price specifications for the same offer, e.g. SRP for the suggested retail price or INVOICE for the invoice price, mostly used in the car industry.', - 'referenceQuantity' => 'The reference quantity for which a certain price applies, e.g. 1 EUR per 4 kWh of electricity. This property is a replacement for unitOfMeasurement for the advanced cases where the price does not relate to a standard unit.', - 'unitCode' => 'The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.', - 'unitText' => 'A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'billingDuration' => 'Specifies for how long this price (or price component) will be billed. Can be used, for example, to model the contractual duration of a subscription or payment plan. Type can be either a Duration or a Number (in which case the unit of measurement, for example month, is specified by the unitCode property).', + 'billingIncrement' => 'This property specifies the minimal quantity and rounding increment that will be the basis for the billing. The unit of measurement is specified by the unitCode property.', + 'billingStart' => 'Specifies after how much time this price (or price component) becomes valid and billing starts. Can be used, for example, to model a price increase after the first year of a subscription. The unit of measurement is specified by the unitCode property.', + 'description' => 'A description of the item.', + '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.', + 'eligibleQuantity' => 'The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.', + 'eligibleTransactionVolume' => 'The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maxPrice' => 'The highest price if the price is a range.', + 'minPrice' => 'The lowest price if the price is a range.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'price' => 'The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes. Usage guidelines: * Use the [[priceCurrency]] property (with 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as \'$\' in the value. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator. * Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting. * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similiar Unicode symbols. ', + 'priceComponentType' => 'Identifies a price component (for example, a line item on an invoice), part of the total price for an offer.', + '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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'priceType' => 'Defines the type of a price specified for an offered product, for example a list price, a (temporary) sale price or a manufacturer suggested retail price. If multiple prices are specified for an offer the [[priceType]] property can be used to identify the type of each such specified price. The value of priceType can be specified as a value from enumeration PriceTypeEnumeration or as a free form text string for price types that are not already predefined in PriceTypeEnumeration.', + 'referenceQuantity' => 'The reference quantity for which a certain price applies, e.g. 1 EUR per 4 kWh of electricity. This property is a replacement for unitOfMeasurement for the advanced cases where the price does not relate to a standard unit.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'unitCode' => 'The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.', + 'unitText' => 'A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode.', + 'url' => 'URL of the item.', + 'validFrom' => 'The date when the item becomes valid.', + 'validThrough' => 'The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.', + 'valueAddedTaxIncluded' => 'Specifies whether the applicable value-added tax (VAT) is included in the price specification or not.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * This property specifies the minimal quantity and rounding increment that - * will be the basis for the billing. The unit of measurement is specified by - * the unitCode property. - * - * @var float [schema.org types: Number] - */ - public $billingIncrement; - /** - * A short text or acronym indicating multiple price specifications for the - * same offer, e.g. SRP for the suggested retail price or INVOICE for the - * invoice price, mostly used in the car industry. - * - * @var string [schema.org types: Text] - */ - public $priceType; - /** - * The reference quantity for which a certain price applies, e.g. 1 EUR per 4 - * kWh of electricity. This property is a replacement for unitOfMeasurement - * for the advanced cases where the price does not relate to a standard unit. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $referenceQuantity; - /** - * The unit of measurement given using the UN/CEFACT Common Code (3 - * characters) or a URL. Other codes than the UN/CEFACT Common Code may be - * used with a prefix followed by a colon. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $unitCode; - /** - * A string or text indicating the unit of measurement. Useful if you cannot - * provide a standard unit code for unitCode. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $unitText; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['billingIncrement', 'priceType', 'referenceQuantity', 'unitCode', 'unitText'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UnitPriceSpecificationInterface.php b/src/models/jsonld/UnitPriceSpecificationInterface.php new file mode 100644 index 000000000..8da75f439 --- /dev/null +++ b/src/models/jsonld/UnitPriceSpecificationInterface.php @@ -0,0 +1,24 @@ +unitCode. + * + * @var string|Text + */ + public $unitText; + + /** + * This property specifies the minimal quantity and rounding increment that + * will be the basis for the billing. The unit of measurement is specified by + * the unitCode property. + * + * @var float|Number + */ + public $billingIncrement; + + /** + * The unit of measurement given using the UN/CEFACT Common Code (3 + * characters) or a URL. Other codes than the UN/CEFACT Common Code may be + * used with a prefix followed by a colon. + * + * @var string|Text|URL + */ + public $unitCode; + + /** + * Specifies for how long this price (or price component) will be billed. Can + * be used, for example, to model the contractual duration of a subscription + * or payment plan. Type can be either a Duration or a Number (in which case + * the unit of measurement, for example month, is specified by the unitCode + * property). + * + * @var float|Duration|QuantitativeValue|Number + */ + public $billingDuration; + + /** + * The reference quantity for which a certain price applies, e.g. 1 EUR per 4 + * kWh of electricity. This property is a replacement for unitOfMeasurement + * for the advanced cases where the price does not relate to a standard unit. + * + * @var QuantitativeValue + */ + public $referenceQuantity; + + /** + * Identifies a price component (for example, a line item on an invoice), part + * of the total price for an offer. + * + * @var PriceComponentTypeEnumeration + */ + public $priceComponentType; + + /** + * Specifies after how much time this price (or price component) becomes valid + * and billing starts. Can be used, for example, to model a price increase + * after the first year of a subscription. The unit of measurement is + * specified by the unitCode property. + * + * @var float|Number + */ + public $billingStart; + +} diff --git a/src/models/jsonld/UnofficialLegalValue.php b/src/models/jsonld/UnofficialLegalValue.php index 3ed691089..637ea9de2 100644 --- a/src/models/jsonld/UnofficialLegalValue.php +++ b/src/models/jsonld/UnofficialLegalValue.php @@ -1,28 +1,28 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UnofficialLegalValueInterface.php b/src/models/jsonld/UnofficialLegalValueInterface.php new file mode 100644 index 000000000..1c81c1bdb --- /dev/null +++ b/src/models/jsonld/UnofficialLegalValueInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'collection' => ['Thing'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'targetCollection' => ['Thing'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'targetCollection' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'collection' => 'A sub property of object. The collection target of the action.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'targetCollection' => 'A sub property of object. The collection target of the action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'targetCollection' => ['Thing'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'targetCollection' => 'A sub property of object. The collection target of the action. Supersedes collection.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of object. The collection target of the action. Supersedes - * collection. - * - * @var Thing [schema.org types: Thing] + * @inheritdoc */ - public $targetCollection; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['targetCollection'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UpdateActionInterface.php b/src/models/jsonld/UpdateActionInterface.php new file mode 100644 index 000000000..68d0e1382 --- /dev/null +++ b/src/models/jsonld/UpdateActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UrologicInterface.php b/src/models/jsonld/UrologicInterface.php new file mode 100644 index 000000000..46f5c8abb --- /dev/null +++ b/src/models/jsonld/UrologicInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UsageOrScheduleHealthAspectInterface.php b/src/models/jsonld/UsageOrScheduleHealthAspectInterface.php new file mode 100644 index 000000000..63132282f --- /dev/null +++ b/src/models/jsonld/UsageOrScheduleHealthAspectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UseActionInterface.php b/src/models/jsonld/UseActionInterface.php new file mode 100644 index 000000000..d7acca914 --- /dev/null +++ b/src/models/jsonld/UseActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UsedConditionInterface.php b/src/models/jsonld/UsedConditionInterface.php new file mode 100644 index 000000000..b603a27cb --- /dev/null +++ b/src/models/jsonld/UsedConditionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserBlocksInterface.php b/src/models/jsonld/UserBlocksInterface.php new file mode 100644 index 000000000..9e5e9254c --- /dev/null +++ b/src/models/jsonld/UserBlocksInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserCheckinsInterface.php b/src/models/jsonld/UserCheckinsInterface.php new file mode 100644 index 000000000..50efa208c --- /dev/null +++ b/src/models/jsonld/UserCheckinsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'commentText' => ['Text'], + 'commentTime' => ['DateTime', 'Date'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'creator' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discusses' => ['CreativeWork'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'replyToUrl' => ['URL'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'commentText' => 'The text of the UserComment.', + 'commentTime' => 'The time at which the UserComment was made.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'discusses' => 'Specifies the CreativeWork associated with the UserComment.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'replyToUrl' => 'The URL at which a reply may be posted to the specified UserComment.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserCommentsInterface.php b/src/models/jsonld/UserCommentsInterface.php new file mode 100644 index 000000000..86fbe9b07 --- /dev/null +++ b/src/models/jsonld/UserCommentsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserDownloadsInterface.php b/src/models/jsonld/UserDownloadsInterface.php new file mode 100644 index 000000000..b2b7e26c0 --- /dev/null +++ b/src/models/jsonld/UserDownloadsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserInteractionInterface.php b/src/models/jsonld/UserInteractionInterface.php new file mode 100644 index 000000000..7f4c04213 --- /dev/null +++ b/src/models/jsonld/UserInteractionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserLikesInterface.php b/src/models/jsonld/UserLikesInterface.php new file mode 100644 index 000000000..d7ee5df4c --- /dev/null +++ b/src/models/jsonld/UserLikesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserPageVisitsInterface.php b/src/models/jsonld/UserPageVisitsInterface.php new file mode 100644 index 000000000..df1f59a51 --- /dev/null +++ b/src/models/jsonld/UserPageVisitsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserPlaysInterface.php b/src/models/jsonld/UserPlaysInterface.php new file mode 100644 index 000000000..9f0eccbb6 --- /dev/null +++ b/src/models/jsonld/UserPlaysInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserPlusOnesInterface.php b/src/models/jsonld/UserPlusOnesInterface.php new file mode 100644 index 000000000..e8a85e361 --- /dev/null +++ b/src/models/jsonld/UserPlusOnesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedClaimReview' => ['Review'], + 'associatedMedia' => ['MediaObject'], + 'associatedMediaReview' => ['Review'], + 'associatedReview' => ['Review'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'itemReviewed' => ['Thing'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'negativeNotes' => ['ListItem', 'Text', 'WebContent', 'ItemList'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'positiveNotes' => ['WebContent', 'Text', 'ListItem', 'ItemList'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewAspect' => ['Text'], + 'reviewBody' => ['Text'], + 'reviewRating' => ['Rating'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'itemReviewed', - 'reviewAspect', - 'reviewBody', - 'reviewRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'itemReviewed' => ['Thing'], - 'reviewAspect' => ['Text'], - 'reviewBody' => ['Text'], - 'reviewRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'itemReviewed' => 'The item that is being reviewed/rated.', - 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', - 'reviewBody' => 'The actual body of the review.', - 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The reviewRating applies to rating given by the review. The aggregateRating property applies to the review itself, as a creative work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedClaimReview' => 'An associated [[ClaimReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'associatedMediaReview' => 'An associated [[MediaReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]].', + 'associatedReview' => 'An associated [[Review]].', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'itemReviewed' => 'The item that is being reviewed/rated.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + 'negativeNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), negative considerations - either as unstructured text, or a list.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'positiveNotes' => 'Indicates, in the context of a [[Review]] (e.g. framed as \'pro\' vs \'con\' considerations), positive considerations - either as unstructured text, or a list.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewAspect' => 'This Review or Rating is relevant to this part or facet of the itemReviewed.', + 'reviewBody' => 'The actual body of the review.', + 'reviewRating' => 'The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating``` applies to rating given by the review. The [[aggregateRating]] property applies to the review itself, as a creative work.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The item that is being reviewed/rated. - * - * @var Thing [schema.org types: Thing] - */ - public $itemReviewed; - /** - * This Review or Rating is relevant to this part or facet of the - * itemReviewed. - * - * @var string [schema.org types: Text] - */ - public $reviewAspect; - /** - * The actual body of the review. - * - * @var string [schema.org types: Text] - */ - public $reviewBody; /** - * The rating given in this review. Note that reviews can themselves be rated. - * The reviewRating applies to rating given by the review. The aggregateRating - * property applies to the review itself, as a creative work. - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $reviewRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['itemReviewed', 'reviewAspect', 'reviewBody', 'reviewRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/UserReviewInterface.php b/src/models/jsonld/UserReviewInterface.php new file mode 100644 index 000000000..af9b94aaf --- /dev/null +++ b/src/models/jsonld/UserReviewInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/UserTweetsInterface.php b/src/models/jsonld/UserTweetsInterface.php new file mode 100644 index 000000000..687a7d6c6 --- /dev/null +++ b/src/models/jsonld/UserTweetsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VeganDietInterface.php b/src/models/jsonld/VeganDietInterface.php new file mode 100644 index 000000000..71a1229d5 --- /dev/null +++ b/src/models/jsonld/VeganDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VegetarianDietInterface.php b/src/models/jsonld/VegetarianDietInterface.php new file mode 100644 index 000000000..7fc264054 --- /dev/null +++ b/src/models/jsonld/VegetarianDietInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'accelerationTime' => ['QuantitativeValue'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'audience' => ['Audience'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bodyType' => ['QualitativeValue', 'Text', 'URL'], + 'brand' => ['Organization', 'Brand'], + 'callSign' => ['Text'], + 'cargoVolume' => ['QuantitativeValue'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'color' => ['Text'], + 'countryOfAssembly' => ['Text'], + 'countryOfLastProcessing' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'dateVehicleFirstRegistered' => ['Date'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'driveWheelConfiguration' => ['Text', 'DriveWheelConfigurationValue'], + 'emissionsCO2' => ['Number'], + 'fuelCapacity' => ['QuantitativeValue'], + 'fuelConsumption' => ['QuantitativeValue'], + 'fuelEfficiency' => ['QuantitativeValue'], + 'fuelType' => ['Text', 'URL', 'QualitativeValue'], + 'funding' => ['Grant'], + 'gtin' => ['Text'], + 'gtin12' => ['Text'], + 'gtin13' => ['Text'], + 'gtin14' => ['Text'], + 'gtin8' => ['Text'], + 'hasAdultConsideration' => ['AdultOrientedEnumeration'], + 'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'], + 'hasMeasurement' => ['QuantitativeValue'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inProductGroupWithID' => ['Text'], + 'isAccessoryOrSparePartFor' => ['Product'], + 'isConsumableFor' => ['Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'isVariantOf' => ['ProductModel', 'ProductGroup'], + 'itemCondition' => ['OfferItemCondition'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knownVehicleDamages' => ['Text'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'manufacturer' => ['Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'meetsEmissionStandard' => ['Text', 'URL', 'QualitativeValue'], + 'mileageFromOdometer' => ['QuantitativeValue'], + 'model' => ['ProductModel', 'Text'], + 'modelDate' => ['Date'], + 'mpn' => ['Text'], + 'name' => ['Text'], + 'nsn' => ['Text'], + 'numberOfAirbags' => ['Text', 'Number'], + 'numberOfAxles' => ['Number', 'QuantitativeValue'], + 'numberOfDoors' => ['QuantitativeValue', 'Number'], + 'numberOfForwardGears' => ['QuantitativeValue', 'Number'], + 'numberOfPreviousOwners' => ['Number', 'QuantitativeValue'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'payload' => ['QuantitativeValue'], + 'potentialAction' => ['Action'], + 'productID' => ['Text'], + 'productionDate' => ['Date'], + 'purchaseDate' => ['Date'], + 'releaseDate' => ['Date'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seatingCapacity' => ['QuantitativeValue', 'Number'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sku' => ['Text'], + 'slogan' => ['Text'], + 'speed' => ['QuantitativeValue'], + 'steeringPosition' => ['SteeringPositionValue'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'tongueWeight' => ['QuantitativeValue'], + 'trailerWeight' => ['QuantitativeValue'], + 'url' => ['URL'], + 'vehicleConfiguration' => ['Text'], + 'vehicleEngine' => ['EngineSpecification'], + 'vehicleIdentificationNumber' => ['Text'], + 'vehicleInteriorColor' => ['Text'], + 'vehicleInteriorType' => ['Text'], + 'vehicleModelDate' => ['Date'], + 'vehicleSeatingCapacity' => ['QuantitativeValue', 'Number'], + 'vehicleSpecialUsage' => ['CarUsageType', 'Text'], + 'vehicleTransmission' => ['Text', 'QualitativeValue', 'URL'], + 'weight' => ['QuantitativeValue'], + 'weightTotal' => ['QuantitativeValue'], + 'wheelbase' => ['QuantitativeValue'], + 'width' => ['QuantitativeValue', 'Distance'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'accelerationTime', - 'bodyType', - 'callSign', - 'cargoVolume', - 'dateVehicleFirstRegistered', - 'driveWheelConfiguration', - 'emissionsCO2', - 'fuelCapacity', - 'fuelConsumption', - 'fuelEfficiency', - 'fuelType', - 'knownVehicleDamages', - 'meetsEmissionStandard', - 'mileageFromOdometer', - 'modelDate', - 'numberOfAirbags', - 'numberOfAxles', - 'numberOfDoors', - 'numberOfForwardGears', - 'numberOfPreviousOwners', - 'payload', - 'productionDate', - 'purchaseDate', - 'seatingCapacity', - 'speed', - 'steeringPosition', - 'tongueWeight', - 'trailerWeight', - 'vehicleConfiguration', - 'vehicleEngine', - 'vehicleIdentificationNumber', - 'vehicleInteriorColor', - 'vehicleInteriorType', - 'vehicleModelDate', - 'vehicleSeatingCapacity', - 'vehicleSpecialUsage', - 'vehicleTransmission', - 'weightTotal', - 'wheelbase' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'accelerationTime' => ['QuantitativeValue'], - 'bodyType' => ['QualitativeValue', 'Text', 'URL'], - 'callSign' => ['Text'], - 'cargoVolume' => ['QuantitativeValue'], - 'dateVehicleFirstRegistered' => ['Date'], - 'driveWheelConfiguration' => ['DriveWheelConfigurationValue', 'Text'], - 'emissionsCO2' => ['Number'], - 'fuelCapacity' => ['QuantitativeValue'], - 'fuelConsumption' => ['QuantitativeValue'], - 'fuelEfficiency' => ['QuantitativeValue'], - 'fuelType' => ['QualitativeValue', 'Text', 'URL'], - 'knownVehicleDamages' => ['Text'], - 'meetsEmissionStandard' => ['QualitativeValue', 'Text', 'URL'], - 'mileageFromOdometer' => ['QuantitativeValue'], - 'modelDate' => ['Date'], - 'numberOfAirbags' => ['Number', 'Text'], - 'numberOfAxles' => ['Number', 'QuantitativeValue'], - 'numberOfDoors' => ['Number', 'QuantitativeValue'], - 'numberOfForwardGears' => ['Number', 'QuantitativeValue'], - 'numberOfPreviousOwners' => ['Number', 'QuantitativeValue'], - 'payload' => ['QuantitativeValue'], - 'productionDate' => ['Date'], - 'purchaseDate' => ['Date'], - 'seatingCapacity' => ['Number', 'QuantitativeValue'], - 'speed' => ['QuantitativeValue'], - 'steeringPosition' => ['SteeringPositionValue'], - 'tongueWeight' => ['QuantitativeValue'], - 'trailerWeight' => ['QuantitativeValue'], - 'vehicleConfiguration' => ['Text'], - 'vehicleEngine' => ['EngineSpecification'], - 'vehicleIdentificationNumber' => ['Text'], - 'vehicleInteriorColor' => ['Text'], - 'vehicleInteriorType' => ['Text'], - 'vehicleModelDate' => ['Date'], - 'vehicleSeatingCapacity' => ['Number', 'QuantitativeValue'], - 'vehicleSpecialUsage' => ['CarUsageType', 'Text'], - 'vehicleTransmission' => ['QualitativeValue', 'Text', 'URL'], - 'weightTotal' => ['QuantitativeValue'], - 'wheelbase' => ['QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'accelerationTime' => 'The time needed to accelerate the vehicle from a given start velocity to a given target velocity. Typical unit code(s): SEC for seconds Note: There are unfortunately no standard unit codes for seconds/0..100 km/h or seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities in the name of the QuantitativeValue, or use valueReference with a QuantitativeValue of 0..60 mph or 0..100 km/h to specify the reference speeds.', - 'bodyType' => 'Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).', - 'callSign' => 'A callsign, as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', - 'cargoVolume' => 'The available volume for cargo or luggage. For automobiles, this is usually the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic foot/feet Note: You can use minValue and maxValue to indicate ranges.', - 'dateVehicleFirstRegistered' => 'The date of the first registration of the vehicle with the respective public authorities.', - 'driveWheelConfiguration' => 'The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle\'s engine via the drivetrain.', - 'emissionsCO2' => 'The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put "g/km" into the unitText property of that value, since there is no UN/CEFACT Common Code for "g/km".', - 'fuelCapacity' => 'The capacity of the fuel tank or in the case of electric cars, the battery. If there are multiple components for storage, this should indicate the total of all storage of the same type. Typical unit code(s): LTR for liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for ampere-hours (for electrical vehicles).', - 'fuelConsumption' => 'The amount of fuel consumed for traveling a particular distance or temporal duration with the given vehicle (e.g. liters per 100 km). Note 1: There are unfortunately no standard unit codes for liters per 100 km. Use unitText to indicate the unit of measurement, e.g. L/100 km. Note 2: There are two ways of indicating the fuel consumption, fuelConsumption (e.g. 8 liters per 100 km) and fuelEfficiency (e.g. 30 miles per gallon). They are reciprocal. Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use valueReference to link the value for the fuel consumption to another value.', - 'fuelEfficiency' => 'The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers per liter (km/L). Note 1: There are unfortunately no standard unit codes for miles per gallon or kilometers per liter. Use unitText to indicate the unit of measurement, e.g. mpg or km/L. Note 2: There are two ways of indicating the fuel consumption, fuelConsumption (e.g. 8 liters per 100 km) and fuelEfficiency (e.g. 30 miles per gallon). They are reciprocal. Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use valueReference to link the value for the fuel economy to another value.', - 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', - 'knownVehicleDamages' => 'A textual description of known damages, both repaired and unrepaired.', - 'meetsEmissionStandard' => 'Indicates that the vehicle meets the respective emission standard.', - 'mileageFromOdometer' => 'The total distance travelled by the particular vehicle since its initial production, as read from its odometer. Typical unit code(s): KMT for kilometers, SMI for statute miles', - 'modelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', - 'numberOfAirbags' => 'The number or type of airbags in the vehicle.', - 'numberOfAxles' => 'The number of axles. Typical unit code(s): C62', - 'numberOfDoors' => 'The number of doors. Typical unit code(s): C62', - 'numberOfForwardGears' => 'The total number of forward gears available for the transmission system of the vehicle. Typical unit code(s): C62', - 'numberOfPreviousOwners' => 'The number of owners of the vehicle, including the current one. Typical unit code(s): C62', - 'payload' => 'The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note 1: Many databases specify the permitted TOTAL weight instead, which is the sum of weight and payload Note 2: You can indicate additional information in the name of the QuantitativeValue node. Note 3: You may also link to a QualitativeValue node that provides additional information using valueReference. Note 4: Note that you can use minValue and maxValue to indicate ranges.', - 'productionDate' => 'The date of production of the item, e.g. vehicle.', - 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', - 'seatingCapacity' => 'The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons', - 'speed' => 'The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit of the speed range (indicated by maxValue should be the maximum speed achievable under regular conditions. Typical unit code(s): KMH for km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use minValue and maxValue to indicate the range. Typically, the minimal value is zero. * Note 2: There are many different ways of measuring the speed range. You can link to information about how the given value has been determined using the valueReference property.', - 'steeringPosition' => 'The position of the steering wheel or similar device (mostly for cars).', - 'tongueWeight' => 'The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can indicate additional information in the name of the QuantitativeValue node. Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference. Note 3: Note that you can use minValue and maxValue to indicate ranges.', - 'trailerWeight' => 'The permitted weight of a trailer attached to the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the name of the QuantitativeValue node. * Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference. * Note 3: Note that you can use minValue and maxValue to indicate ranges.', - 'vehicleConfiguration' => 'A short text indicating the configuration of the vehicle, e.g. \'5dr hatchback ST 2.5 MT 225 hp\' or \'limited edition\'.', - 'vehicleEngine' => 'Information about the engine or engines of the vehicle.', - 'vehicleIdentificationNumber' => 'The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles.', - 'vehicleInteriorColor' => 'The color or color combination of the interior of the vehicle.', - 'vehicleInteriorType' => 'The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.). While most interior types are characterized by the material used, an interior type can also be based on vehicle usage or target audience.', - 'vehicleModelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', - 'vehicleSeatingCapacity' => 'The number of passengers that can be seated in the vehicle, both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons.', - 'vehicleSpecialUsage' => 'Indicates whether the vehicle has been used for special purposes, like commercial rental, driving school, or as a taxi. The legislation in many countries requires this information to be revealed when offering a car for sale.', - 'vehicleTransmission' => 'The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars).', - 'weightTotal' => 'The permitted total weight of the loaded vehicle, including passengers and cargo and the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can indicate additional information in the name of the QuantitativeValue node. Note 2: You may also link to a QualitativeValue node that provides additional information using valueReference. Note 3: Note that you can use minValue and maxValue to indicate ranges.', - 'wheelbase' => 'The distance between the centers of the front and rear wheels. Typical unit code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The time needed to accelerate the vehicle from a given start velocity to a - * given target velocity. Typical unit code(s): SEC for seconds Note: There - * are unfortunately no standard unit codes for seconds/0..100 km/h or - * seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities - * in the name of the QuantitativeValue, or use valueReference with a - * QuantitativeValue of 0..60 mph or 0..100 km/h to specify the reference - * speeds. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $accelerationTime; /** - * Indicates the design and body style of the vehicle (e.g. station wagon, - * hatchback, etc.). - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $bodyType; - /** - * A callsign, as used in broadcasting and radio communications to identify - * people, radio and TV stations, or vehicles. - * - * @var string [schema.org types: Text] - */ - public $callSign; - /** - * The available volume for cargo or luggage. For automobiles, this is usually - * the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic - * foot/feet Note: You can use minValue and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $cargoVolume; - /** - * The date of the first registration of the vehicle with the respective - * public authorities. - * - * @var Date [schema.org types: Date] - */ - public $dateVehicleFirstRegistered; - /** - * The drive wheel configuration, i.e. which roadwheels will receive torque - * from the vehicle's engine via the drivetrain. - * - * @var mixed|DriveWheelConfigurationValue|string [schema.org types: DriveWheelConfigurationValue, Text] - */ - public $driveWheelConfiguration; - /** - * The CO2 emissions in g/km. When used in combination with a - * QuantitativeValue, put "g/km" into the unitText property of that value, - * since there is no UN/CEFACT Common Code for "g/km". - * - * @var float [schema.org types: Number] - */ - public $emissionsCO2; - /** - * The capacity of the fuel tank or in the case of electric cars, the battery. - * If there are multiple components for storage, this should indicate the - * total of all storage of the same type. Typical unit code(s): LTR for - * liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for - * ampere-hours (for electrical vehicles). - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $fuelCapacity; - /** - * The amount of fuel consumed for traveling a particular distance or temporal - * duration with the given vehicle (e.g. liters per 100 km). Note 1: There are - * unfortunately no standard unit codes for liters per 100 km. Use unitText to - * indicate the unit of measurement, e.g. L/100 km. Note 2: There are two ways - * of indicating the fuel consumption, fuelConsumption (e.g. 8 liters per 100 - * km) and fuelEfficiency (e.g. 30 miles per gallon). They are reciprocal. - * Note 3: Often, the absolute value is useful only when related to driving - * speed ("at 80 km/h") or usage pattern ("city traffic"). You can use - * valueReference to link the value for the fuel consumption to another value. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $fuelConsumption; - /** - * The distance traveled per unit of fuel used; most commonly miles per gallon - * (mpg) or kilometers per liter (km/L). Note 1: There are unfortunately no - * standard unit codes for miles per gallon or kilometers per liter. Use - * unitText to indicate the unit of measurement, e.g. mpg or km/L. Note 2: - * There are two ways of indicating the fuel consumption, fuelConsumption - * (e.g. 8 liters per 100 km) and fuelEfficiency (e.g. 30 miles per gallon). - * They are reciprocal. Note 3: Often, the absolute value is useful only when - * related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). - * You can use valueReference to link the value for the fuel economy to - * another value. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $fuelEfficiency; - /** - * The type of fuel suitable for the engine or engines of the vehicle. If the - * vehicle has only one engine, this property can be attached directly to the - * vehicle. - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $fuelType; - /** - * A textual description of known damages, both repaired and unrepaired. - * - * @var string [schema.org types: Text] - */ - public $knownVehicleDamages; - /** - * Indicates that the vehicle meets the respective emission standard. - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $meetsEmissionStandard; - /** - * The total distance travelled by the particular vehicle since its initial - * production, as read from its odometer. Typical unit code(s): KMT for - * kilometers, SMI for statute miles - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $mileageFromOdometer; - /** - * The release date of a vehicle model (often used to differentiate versions - * of the same make and model). - * - * @var Date [schema.org types: Date] - */ - public $modelDate; - /** - * The number or type of airbags in the vehicle. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $numberOfAirbags; - /** - * The number of axles. Typical unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfAxles; - /** - * The number of doors. Typical unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfDoors; - /** - * The total number of forward gears available for the transmission system of - * the vehicle. Typical unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfForwardGears; - /** - * The number of owners of the vehicle, including the current one. Typical - * unit code(s): C62 - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $numberOfPreviousOwners; - /** - * The permitted weight of passengers and cargo, EXCLUDING the weight of the - * empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound Note - * 1: Many databases specify the permitted TOTAL weight instead, which is the - * sum of weight and payload Note 2: You can indicate additional information - * in the name of the QuantitativeValue node. Note 3: You may also link to a - * QualitativeValue node that provides additional information using - * valueReference. Note 4: Note that you can use minValue and maxValue to - * indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $payload; - /** - * The date of production of the item, e.g. vehicle. - * - * @var Date [schema.org types: Date] - */ - public $productionDate; - /** - * The date the item e.g. vehicle was purchased by the current owner. - * - * @var Date [schema.org types: Date] - */ - public $purchaseDate; - /** - * The number of persons that can be seated (e.g. in a vehicle), both in terms - * of the physical space available, and in terms of limitations set by law. - * Typical unit code(s): C62 for persons - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $seatingCapacity; - /** - * The speed range of the vehicle. If the vehicle is powered by an engine, the - * upper limit of the speed range (indicated by maxValue should be the maximum - * speed achievable under regular conditions. Typical unit code(s): KMH for - * km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use - * minValue and maxValue to indicate the range. Typically, the minimal value - * is zero. * Note 2: There are many different ways of measuring the speed - * range. You can link to information about how the given value has been - * determined using the valueReference property. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $speed; - /** - * The position of the steering wheel or similar device (mostly for cars). - * - * @var SteeringPositionValue [schema.org types: SteeringPositionValue] - */ - public $steeringPosition; - /** - * The permitted vertical load (TWR) of a trailer attached to the vehicle. - * Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) - * Typical unit code(s): KGM for kilogram, LBR for pound Note 1: You can - * indicate additional information in the name of the QuantitativeValue node. - * Note 2: You may also link to a QualitativeValue node that provides - * additional information using valueReference. Note 3: Note that you can use - * minValue and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $tongueWeight; - /** - * The permitted weight of a trailer attached to the vehicle. Typical unit - * code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate - * additional information in the name of the QuantitativeValue node. * Note 2: - * You may also link to a QualitativeValue node that provides additional - * information using valueReference. * Note 3: Note that you can use minValue - * and maxValue to indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $trailerWeight; - /** - * A short text indicating the configuration of the vehicle, e.g. '5dr - * hatchback ST 2.5 MT 225 hp' or 'limited edition'. - * - * @var string [schema.org types: Text] - */ - public $vehicleConfiguration; - /** - * Information about the engine or engines of the vehicle. - * - * @var EngineSpecification [schema.org types: EngineSpecification] - */ - public $vehicleEngine; - /** - * The Vehicle Identification Number (VIN) is a unique serial number used by - * the automotive industry to identify individual motor vehicles. - * - * @var string [schema.org types: Text] - */ - public $vehicleIdentificationNumber; - /** - * The color or color combination of the interior of the vehicle. - * - * @var string [schema.org types: Text] - */ - public $vehicleInteriorColor; - /** - * The type or material of the interior of the vehicle (e.g. synthetic fabric, - * leather, wood, etc.). While most interior types are characterized by the - * material used, an interior type can also be based on vehicle usage or - * target audience. - * - * @var string [schema.org types: Text] - */ - public $vehicleInteriorType; - /** - * The release date of a vehicle model (often used to differentiate versions - * of the same make and model). - * - * @var Date [schema.org types: Date] + * @inheritdoc */ - public $vehicleModelDate; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'accelerationTime' => 'The time needed to accelerate the vehicle from a given start velocity to a given target velocity. Typical unit code(s): SEC for seconds * Note: There are unfortunately no standard unit codes for seconds/0..100 km/h or seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities in the [[name]] of the [[QuantitativeValue]], or use [[valueReference]] with a [[QuantitativeValue]] of 0..60 mph or 0..100 km/h to specify the reference speeds.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bodyType' => 'Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'callSign' => 'A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles.', + 'cargoVolume' => 'The available volume for cargo or luggage. For automobiles, this is usually the trunk volume. Typical unit code(s): LTR for liters, FTQ for cubic foot/feet Note: You can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'color' => 'The color of the product.', + 'countryOfAssembly' => 'The place where the product was assembled.', + 'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'dateVehicleFirstRegistered' => 'The date of the first registration of the vehicle with the respective public authorities.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'driveWheelConfiguration' => 'The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle\'s engine via the drivetrain.', + 'emissionsCO2' => 'The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put "g/km" into the unitText property of that value, since there is no UN/CEFACT Common Code for "g/km".', + 'fuelCapacity' => 'The capacity of the fuel tank or in the case of electric cars, the battery. If there are multiple components for storage, this should indicate the total of all storage of the same type. Typical unit code(s): LTR for liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for ampere-hours (for electrical vehicles).', + 'fuelConsumption' => 'The amount of fuel consumed for traveling a particular distance or temporal duration with the given vehicle (e.g. liters per 100 km). * Note 1: There are unfortunately no standard unit codes for liters per 100 km. Use [[unitText]] to indicate the unit of measurement, e.g. L/100 km. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel consumption to another value.', + 'fuelEfficiency' => 'The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers per liter (km/L). * Note 1: There are unfortunately no standard unit codes for miles per gallon or kilometers per liter. Use [[unitText]] to indicate the unit of measurement, e.g. mpg or km/L. * Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal. * Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel economy to another value.', + 'fuelType' => 'The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. ', + 'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.', + 'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.', + 'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.', + 'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ', + 'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.', + 'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.', + 'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.', + '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.', + 'knownVehicleDamages' => 'A textual description of known damages, both repaired and unrepaired.', + 'logo' => 'An associated logo.', + '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.', + 'manufacturer' => 'The manufacturer of the product.', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'meetsEmissionStandard' => 'Indicates that the vehicle meets the respective emission standard.', + 'mileageFromOdometer' => 'The total distance travelled by the particular vehicle since its initial production, as read from its odometer. Typical unit code(s): KMT for kilometers, SMI for statute miles', + 'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.', + 'modelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.', + 'name' => 'The name of the item.', + 'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ', + 'numberOfAirbags' => 'The number or type of airbags in the vehicle.', + 'numberOfAxles' => 'The number of axles. Typical unit code(s): C62', + 'numberOfDoors' => 'The number of doors. Typical unit code(s): C62', + 'numberOfForwardGears' => 'The total number of forward gears available for the transmission system of the vehicle. Typical unit code(s): C62', + 'numberOfPreviousOwners' => 'The number of owners of the vehicle, including the current one. Typical unit code(s): C62', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'payload' => 'The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: Many databases specify the permitted TOTAL weight instead, which is the sum of [[weight]] and [[payload]] * Note 2: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 3: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 4: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.', + 'productionDate' => 'The date of production of the item, e.g. vehicle.', + 'purchaseDate' => 'The date the item e.g. vehicle was purchased by the current owner.', + 'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seatingCapacity' => 'The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons ', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.', + 'slogan' => 'A slogan or motto associated with the item.', + 'speed' => 'The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit of the speed range (indicated by [[maxValue]] should be the maximum speed achievable under regular conditions. Typical unit code(s): KMH for km/h, HM for mile per hour (0.447 04 m/s), KNT for knot *Note 1: Use [[minValue]] and [[maxValue]] to indicate the range. Typically, the minimal value is zero. * Note 2: There are many different ways of measuring the speed range. You can link to information about how the given value has been determined using the [[valueReference]] property.', + 'steeringPosition' => 'The position of the steering wheel or similar device (mostly for cars).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'tongueWeight' => 'The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'trailerWeight' => 'The permitted weight of a trailer attached to the vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'url' => 'URL of the item.', + 'vehicleConfiguration' => 'A short text indicating the configuration of the vehicle, e.g. \'5dr hatchback ST 2.5 MT 225 hp\' or \'limited edition\'.', + 'vehicleEngine' => 'Information about the engine or engines of the vehicle.', + 'vehicleIdentificationNumber' => 'The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles.', + 'vehicleInteriorColor' => 'The color or color combination of the interior of the vehicle.', + 'vehicleInteriorType' => 'The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.). While most interior types are characterized by the material used, an interior type can also be based on vehicle usage or target audience.', + 'vehicleModelDate' => 'The release date of a vehicle model (often used to differentiate versions of the same make and model).', + 'vehicleSeatingCapacity' => 'The number of passengers that can be seated in the vehicle, both in terms of the physical space available, and in terms of limitations set by law. Typical unit code(s): C62 for persons.', + 'vehicleSpecialUsage' => 'Indicates whether the vehicle has been used for special purposes, like commercial rental, driving school, or as a taxi. The legislation in many countries requires this information to be revealed when offering a car for sale.', + 'vehicleTransmission' => 'The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars).', + 'weight' => 'The weight of the product or person.', + 'weightTotal' => 'The permitted total weight of the loaded vehicle, including passengers and cargo and the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node. * Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]. * Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges.', + 'wheelbase' => 'The distance between the centers of the front and rear wheels. Typical unit code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet', + 'width' => 'The width of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The number of passengers that can be seated in the vehicle, both in terms - * of the physical space available, and in terms of limitations set by law. - * Typical unit code(s): C62 for persons. - * - * @var mixed|float|QuantitativeValue [schema.org types: Number, QuantitativeValue] - */ - public $vehicleSeatingCapacity; - /** - * Indicates whether the vehicle has been used for special purposes, like - * commercial rental, driving school, or as a taxi. The legislation in many - * countries requires this information to be revealed when offering a car for - * sale. - * - * @var mixed|CarUsageType|string [schema.org types: CarUsageType, Text] - */ - public $vehicleSpecialUsage; - /** - * The type of component used for transmitting the power from a rotating power - * source to the wheels or other relevant component(s) ("gearbox" for cars). - * - * @var mixed|QualitativeValue|string|string [schema.org types: QualitativeValue, Text, URL] - */ - public $vehicleTransmission; - /** - * The permitted total weight of the loaded vehicle, including passengers and - * cargo and the weight of the empty vehicle. Typical unit code(s): KGM for - * kilogram, LBR for pound Note 1: You can indicate additional information in - * the name of the QuantitativeValue node. Note 2: You may also link to a - * QualitativeValue node that provides additional information using - * valueReference. Note 3: Note that you can use minValue and maxValue to - * indicate ranges. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $weightTotal; - /** - * The distance between the centers of the front and rear wheels. Typical unit - * code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for - * foot/feet - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $wheelbase; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['accelerationTime', 'bodyType', 'callSign', 'cargoVolume', 'dateVehicleFirstRegistered', 'driveWheelConfiguration', 'emissionsCO2', 'fuelCapacity', 'fuelConsumption', 'fuelEfficiency', 'fuelType', 'knownVehicleDamages', 'meetsEmissionStandard', 'mileageFromOdometer', 'modelDate', 'numberOfAirbags', 'numberOfAxles', 'numberOfDoors', 'numberOfForwardGears', 'numberOfPreviousOwners', 'payload', 'productionDate', 'purchaseDate', 'seatingCapacity', 'speed', 'steeringPosition', 'tongueWeight', 'trailerWeight', 'vehicleConfiguration', 'vehicleEngine', 'vehicleIdentificationNumber', 'vehicleInteriorColor', 'vehicleInteriorType', 'vehicleModelDate', 'vehicleSeatingCapacity', 'vehicleSpecialUsage', 'vehicleTransmission', 'weightTotal', 'wheelbase'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VehicleInterface.php b/src/models/jsonld/VehicleInterface.php new file mode 100644 index 000000000..7eebbbbce --- /dev/null +++ b/src/models/jsonld/VehicleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'drainsTo' => ['Vessel'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'regionDrained' => ['AnatomicalSystem', 'AnatomicalStructure'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'tributary' => ['AnatomicalStructure'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'drainsTo', - 'regionDrained', - 'tributary' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'drainsTo' => ['Vessel'], - 'regionDrained' => ['AnatomicalStructure', 'AnatomicalSystem'], - 'tributary' => ['AnatomicalStructure'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'drainsTo' => 'The vasculature that the vein drains into.', - 'regionDrained' => 'The anatomical or organ system drained by this vessel; generally refers to a specific part of an organ.', - 'tributary' => 'The anatomical or organ system that the vein flows into; a larger structure that the vein connects to.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'drainsTo' => 'The vasculature that the vein drains into.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'regionDrained' => 'The anatomical or organ system drained by this vessel; generally refers to a specific part of an organ.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'tributary' => 'The anatomical or organ system that the vein flows into; a larger structure that the vein connects to.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The vasculature that the vein drains into. - * - * @var Vessel [schema.org types: Vessel] - */ - public $drainsTo; - /** - * The anatomical or organ system drained by this vessel; generally refers to - * a specific part of an organ. - * - * @var mixed|AnatomicalStructure|AnatomicalSystem [schema.org types: AnatomicalStructure, AnatomicalSystem] - */ - public $regionDrained; /** - * The anatomical or organ system that the vein flows into; a larger structure - * that the vein connects to. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $tributary; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['drainsTo', 'regionDrained', 'tributary'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VeinInterface.php b/src/models/jsonld/VeinInterface.php new file mode 100644 index 000000000..1569cec64 --- /dev/null +++ b/src/models/jsonld/VeinInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VenueMapInterface.php b/src/models/jsonld/VenueMapInterface.php new file mode 100644 index 000000000..2ad973d01 --- /dev/null +++ b/src/models/jsonld/VenueMapInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedPathophysiology' => ['Text'], + 'bodyLocation' => ['Text'], + 'code' => ['MedicalCode'], + 'connectedTo' => ['AnatomicalStructure'], + 'description' => ['Text'], + 'diagram' => ['ImageObject'], + 'disambiguatingDescription' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'partOfSystem' => ['AnatomicalSystem'], + 'potentialAction' => ['Action'], + 'recognizingAuthority' => ['Organization'], + 'relatedCondition' => ['MedicalCondition'], + 'relatedTherapy' => ['MedicalTherapy'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'sameAs' => ['URL'], + 'study' => ['MedicalStudy'], + 'subStructure' => ['AnatomicalStructure'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'associatedPathophysiology', - 'bodyLocation', - 'connectedTo', - 'diagram', - 'partOfSystem', - 'relatedCondition', - 'relatedTherapy', - 'subStructure' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'associatedPathophysiology' => ['Text'], - 'bodyLocation' => ['Text'], - 'connectedTo' => ['AnatomicalStructure'], - 'diagram' => ['ImageObject'], - 'partOfSystem' => ['AnatomicalSystem'], - 'relatedCondition' => ['MedicalCondition'], - 'relatedTherapy' => ['MedicalTherapy'], - 'subStructure' => ['AnatomicalStructure'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', - 'bodyLocation' => 'Location in the body of the anatomical structure.', - 'connectedTo' => 'Other anatomical structures to which this structure is connected.', - 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', - 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', - 'relatedCondition' => 'A medical condition associated with this anatomy.', - 'relatedTherapy' => 'A medical therapy related to this anatomy.', - 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * If applicable, a description of the pathophysiology associated with the - * anatomical system, including potential abnormal changes in the mechanical, - * physical, and biochemical functions of the system. - * - * @var string [schema.org types: Text] - */ - public $associatedPathophysiology; - /** - * Location in the body of the anatomical structure. - * - * @var string [schema.org types: Text] - */ - public $bodyLocation; - /** - * Other anatomical structures to which this structure is connected. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $connectedTo; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', + 'bodyLocation' => 'Location in the body of the anatomical structure.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', + 'description' => 'A description of the item.', + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', + '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.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relatedCondition' => 'A medical condition associated with this anatomy.', + 'relatedTherapy' => 'A medical therapy related to this anatomy.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + '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.', + 'study' => 'A medical study or trial related to this entity.', + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * An image containing a diagram that illustrates the structure and/or its - * component substructures and/or connections with other structures. - * - * @var ImageObject [schema.org types: ImageObject] - */ - public $diagram; - /** - * The anatomical or organ system that this structure is part of. - * - * @var AnatomicalSystem [schema.org types: AnatomicalSystem] - */ - public $partOfSystem; - /** - * A medical condition associated with this anatomy. - * - * @var MedicalCondition [schema.org types: MedicalCondition] - */ - public $relatedCondition; /** - * A medical therapy related to this anatomy. - * - * @var MedicalTherapy [schema.org types: MedicalTherapy] - */ - public $relatedTherapy; - /** - * Component (sub-)structure(s) that comprise this anatomical structure. - * - * @var AnatomicalStructure [schema.org types: AnatomicalStructure] + * @inheritdoc */ - public $subStructure; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['associatedPathophysiology', 'bodyLocation', 'connectedTo', 'diagram', 'partOfSystem', 'relatedCondition', 'relatedTherapy', 'subStructure'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VesselInterface.php b/src/models/jsonld/VesselInterface.php new file mode 100644 index 000000000..bdc82377e --- /dev/null +++ b/src/models/jsonld/VesselInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'healthPlanNetworkId' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAcceptingNewPatients' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'medicalSpecialty' => ['MedicalSpecialty'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'healthPlanNetworkId', - 'isAcceptingNewPatients', - 'medicalSpecialty' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'healthPlanNetworkId' => ['Text'], - 'isAcceptingNewPatients' => ['Boolean'], - 'medicalSpecialty' => ['MedicalSpecialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', - 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', - 'medicalSpecialty' => 'A medical specialty of the provider.' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + 'healthPlanNetworkId' => 'Name or unique ID of network. (Networks are often reused across different insurance plans).', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAcceptingNewPatients' => 'Whether the provider is accepting new patients.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'medicalSpecialty' => 'A medical specialty of the provider.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Name or unique ID of network. (Networks are often reused across different - * insurance plans). - * - * @var string [schema.org types: Text] - */ - public $healthPlanNetworkId; - /** - * Whether the provider is accepting new patients. - * - * @var bool [schema.org types: Boolean] - */ - public $isAcceptingNewPatients; /** - * A medical specialty of the provider. - * - * @var MedicalSpecialty [schema.org types: MedicalSpecialty] + * @inheritdoc */ - public $medicalSpecialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['healthPlanNetworkId', 'isAcceptingNewPatients', 'medicalSpecialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VeterinaryCareInterface.php b/src/models/jsonld/VeterinaryCareInterface.php new file mode 100644 index 000000000..3ed91aa45 --- /dev/null +++ b/src/models/jsonld/VeterinaryCareInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VideoGalleryInterface.php b/src/models/jsonld/VideoGalleryInterface.php new file mode 100644 index 000000000..c9a857e42 --- /dev/null +++ b/src/models/jsonld/VideoGalleryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'applicationCategory' => ['Text', 'URL'], + 'applicationSubCategory' => ['URL', 'Text'], + 'applicationSuite' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'availableOnDevice' => ['Text'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'characterAttribute' => ['Thing'], + 'cheatCode' => ['CreativeWork'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countriesNotSupported' => ['Text'], + 'countriesSupported' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'device' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'downloadUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'featureList' => ['Text', 'URL'], + 'fileFormat' => ['URL', 'Text'], + 'fileSize' => ['Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'gameEdition' => ['Text'], + 'gameItem' => ['Thing'], + 'gameLocation' => ['Place', 'URL', 'PostalAddress'], + 'gamePlatform' => ['Text', 'URL', 'Thing'], + 'gameServer' => ['GameServer'], + 'gameTip' => ['CreativeWork'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'installUrl' => ['URL'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'memoryRequirements' => ['Text', 'URL'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'numberOfPlayers' => ['QuantitativeValue'], + 'offers' => ['Offer', 'Demand'], + 'operatingSystem' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'permissions' => ['Text'], + 'playMode' => ['GamePlayMode'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'processorRequirements' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'quest' => ['Thing'], + 'recordedAt' => ['Event'], + 'releaseNotes' => ['URL', 'Text'], + 'releasedEvent' => ['PublicationEvent'], + 'requirements' => ['URL', 'Text'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'screenshot' => ['ImageObject', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'softwareAddOn' => ['SoftwareApplication'], + 'softwareHelp' => ['CreativeWork'], + 'softwareRequirements' => ['URL', 'Text'], + 'softwareVersion' => ['Text'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'storageRequirements' => ['URL', 'Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supportingData' => ['DataFeed'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'cheatCode', - 'director', - 'gamePlatform', - 'gameServer', - 'gameTip', - 'musicBy', - 'playMode', - 'trailer' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'cheatCode' => ['CreativeWork'], - 'director' => ['Person'], - 'gamePlatform' => ['Text', 'Thing', 'URL'], - 'gameServer' => ['GameServer'], - 'gameTip' => ['CreativeWork'], - 'musicBy' => ['MusicGroup', 'Person'], - 'playMode' => ['GamePlayMode'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'cheatCode' => 'Cheat codes to the game.', - '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. Supersedes directors.', - 'gamePlatform' => 'The electronic systems used to play video games.', - 'gameServer' => 'The server on which it is possible to play the game. Inverse property: game.', - 'gameTip' => 'Links to tips, tactics, etc.', - 'musicBy' => 'The composer of the soundtrack.', - 'playMode' => 'Indicates whether this game is multi-player, co-op or single-player. The game can be marked as multi-player, co-op and single-player at the same time.', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * Cheat codes to the game. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $cheatCode; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The electronic systems used to play video games. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] + * @inheritdoc */ - public $gamePlatform; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'applicationCategory' => 'Type of software application, e.g. \'Game, Multimedia\'.', + 'applicationSubCategory' => 'Subcategory of the application, e.g. \'Arcade Game\'.', + 'applicationSuite' => 'The name of the application suite to which the application belongs (e.g. Excel belongs to Office).', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'availableOnDevice' => 'Device required to run the application. Used in cases where a specific make/model is required to run the application.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'characterAttribute' => 'A piece of data that represents a particular aspect of a fictional character (skill, power, character points, advantage, disadvantage).', + 'cheatCode' => 'Cheat codes to the game.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countriesNotSupported' => 'Countries for which the application is not supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', + 'countriesSupported' => 'Countries for which the application is supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + 'device' => 'Device required to run the application. Used in cases where a specific make/model is required to run the application.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'downloadUrl' => 'If the file can be downloaded, URL to download the binary.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'featureList' => 'Features or modules provided by this application (and possibly required by other applications).', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'fileSize' => 'Size of the application / package (e.g. 18MB). In the absence of a unit (MB, KB etc.), KB will be assumed.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gameEdition' => 'The edition of a video game.', + 'gameItem' => 'An item is an object within the game world that can be collected by a player or, occasionally, a non-player character.', + 'gameLocation' => 'Real or fictional location of the game (or part of game).', + 'gamePlatform' => 'The electronic systems used to play video games.', + 'gameServer' => 'The server on which it is possible to play the game.', + 'gameTip' => 'Links to tips, tactics, etc.', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'installUrl' => 'URL at which the app may be installed, if different from the URL of the item.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'memoryRequirements' => 'Minimum memory requirements.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + 'numberOfPlayers' => 'Indicate how many people can play this game (minimum, maximum, or range).', + '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. ', + 'operatingSystem' => 'Operating systems supported (Windows 7, OSX 10.6, Android 1.6).', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'permissions' => 'Permission(s) required to run the app (for example, a mobile app may require full internet access or may run only on wifi).', + 'playMode' => 'Indicates whether this game is multi-player, co-op or single-player. The game can be marked as multi-player, co-op and single-player at the same time.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'processorRequirements' => 'Processor architecture required to run the application (e.g. IA64).', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'quest' => 'The task that a player-controlled character, or group of characters may complete in order to gain a reward.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releaseNotes' => 'Description of what changed in this version.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requirements' => 'Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime).', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'screenshot' => 'A link to a screenshot image of the app.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'softwareAddOn' => 'Additional content for a software application.', + 'softwareHelp' => 'Software application help.', + 'softwareRequirements' => 'Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime).', + 'softwareVersion' => 'Version of the software instance.', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'storageRequirements' => 'Storage requirements (free space required).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supportingData' => 'Supporting data for a SoftwareApplication.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The server on which it is possible to play the game. Inverse property: - * game. - * - * @var GameServer [schema.org types: GameServer] - */ - public $gameServer; - /** - * Links to tips, tactics, etc. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $gameTip; - /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * Indicates whether this game is multi-player, co-op or single-player. The - * game can be marked as multi-player, co-op and single-player at the same - * time. - * - * @var GamePlayMode [schema.org types: GamePlayMode] - */ - public $playMode; - /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'cheatCode', 'director', 'gamePlatform', 'gameServer', 'gameTip', 'musicBy', 'playMode', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VideoGameClip.php b/src/models/jsonld/VideoGameClip.php index 199eb46b4..a14d77ec3 100644 --- a/src/models/jsonld/VideoGameClip.php +++ b/src/models/jsonld/VideoGameClip.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'clipNumber' => ['Text', 'Integer'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endOffset' => ['Number', 'HyperTocEntry'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'partOfEpisode' => ['Episode'], + 'partOfSeason' => ['CreativeWorkSeason'], + 'partOfSeries' => ['CreativeWorkSeries'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startOffset' => ['Number', 'HyperTocEntry'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'clipNumber', - 'director', - 'endOffset', - 'musicBy', - 'partOfEpisode', - 'partOfSeason', - 'partOfSeries', - 'startOffset' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'clipNumber' => ['Integer', 'Text'], - 'director' => ['Person'], - 'endOffset' => ['Number'], - 'musicBy' => ['MusicGroup', 'Person'], - 'partOfEpisode' => ['Episode'], - 'partOfSeason' => ['CreativeWorkSeason'], - 'partOfSeries' => ['CreativeWorkSeries'], - 'startOffset' => ['Number'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'clipNumber' => 'Position of the clip within an ordered group of clips.', - '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. Supersedes directors.', - 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', - 'musicBy' => 'The composer of the soundtrack.', - 'partOfEpisode' => 'The episode to which this clip belongs.', - 'partOfSeason' => 'The season to which this episode belongs.', - 'partOfSeries' => 'The series to which this episode or season belongs. Supersedes partOfTVSeries.', - 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * Position of the clip within an ordered group of clips. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $clipNumber; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The end time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $endOffset; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'clipNumber' => 'Position of the clip within an ordered group of clips.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endOffset' => 'The end time of the clip expressed as the number of seconds from the beginning of the work.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'partOfEpisode' => 'The episode to which this clip belongs.', + 'partOfSeason' => 'The season to which this episode belongs.', + 'partOfSeries' => 'The series to which this episode or season belongs.', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startOffset' => 'The start time of the clip expressed as the number of seconds from the beginning of the work.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The episode to which this clip belongs. - * - * @var Episode [schema.org types: Episode] - */ - public $partOfEpisode; - /** - * The season to which this episode belongs. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $partOfSeason; - /** - * The series to which this episode or season belongs. Supersedes - * partOfTVSeries. - * - * @var CreativeWorkSeries [schema.org types: CreativeWorkSeries] - */ - public $partOfSeries; - /** - * The start time of the clip expressed as the number of seconds from the - * beginning of the work. - * - * @var float [schema.org types: Number] + * @inheritdoc */ - public $startOffset; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'clipNumber', 'director', 'endOffset', 'musicBy', 'partOfEpisode', 'partOfSeason', 'partOfSeries', 'startOffset'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VideoGameClipInterface.php b/src/models/jsonld/VideoGameClipInterface.php new file mode 100644 index 000000000..f7db89895 --- /dev/null +++ b/src/models/jsonld/VideoGameClipInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'characterAttribute' => ['Thing'], + 'cheatCode' => ['CreativeWork'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'containsSeason' => ['CreativeWorkSeason'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endDate' => ['Date', 'DateTime'], + 'episode' => ['Episode'], + 'episodes' => ['Episode'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'gameItem' => ['Thing'], + 'gameLocation' => ['Place', 'URL', 'PostalAddress'], + 'gamePlatform' => ['Text', 'URL', 'Thing'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'numberOfEpisodes' => ['Integer'], + 'numberOfPlayers' => ['QuantitativeValue'], + 'numberOfSeasons' => ['Integer'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playMode' => ['GamePlayMode'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'quest' => ['Thing'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'season' => ['URL', 'CreativeWorkSeason'], + 'seasons' => ['CreativeWorkSeason'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'trailer' => ['VideoObject'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'characterAttribute', - 'cheatCode', - 'containsSeason', - 'director', - 'episode', - 'gameItem', - 'gameLocation', - 'gamePlatform', - 'musicBy', - 'numberOfEpisodes', - 'numberOfPlayers', - 'numberOfSeasons', - 'playMode', - 'productionCompany', - 'quest', - 'trailer' - ]; /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'characterAttribute' => ['Thing'], - 'cheatCode' => ['CreativeWork'], - 'containsSeason' => ['CreativeWorkSeason'], - 'director' => ['Person'], - 'episode' => ['Episode'], - 'gameItem' => ['Thing'], - 'gameLocation' => ['Place', 'PostalAddress', 'URL'], - 'gamePlatform' => ['Text', 'Thing', 'URL'], - 'musicBy' => ['MusicGroup', 'Person'], - 'numberOfEpisodes' => ['Integer'], - 'numberOfPlayers' => ['QuantitativeValue'], - 'numberOfSeasons' => ['Integer'], - 'playMode' => ['GamePlayMode'], - 'productionCompany' => ['Organization'], - 'quest' => ['Thing'], - 'trailer' => ['VideoObject'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'characterAttribute' => 'A piece of data that represents a particular aspect of a fictional character (skill, power, character points, advantage, disadvantage).', - 'cheatCode' => 'Cheat codes to the game.', - 'containsSeason' => 'A season that is part of the media series. Supersedes season.', - '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. Supersedes directors.', - 'episode' => 'An episode of a tv, radio or game media within a series or season. Supersedes episodes.', - 'gameItem' => 'An item is an object within the game world that can be collected by a player or, occasionally, a non-player character.', - 'gameLocation' => 'Real or fictional location of the game (or part of game).', - 'gamePlatform' => 'The electronic systems used to play video games.', - 'musicBy' => 'The composer of the soundtrack.', - 'numberOfEpisodes' => 'The number of episodes in this season or series.', - 'numberOfPlayers' => 'Indicate how many people can play this game (minimum, maximum, or range).', - 'numberOfSeasons' => 'The number of seasons in this series.', - 'playMode' => 'Indicates whether this game is multi-player, co-op or single-player. The game can be marked as multi-player, co-op and single-player at the same time.', - 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', - 'quest' => 'The task that a player-controlled character, or group of characters may complete in order to gain a reward.', - 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * A piece of data that represents a particular aspect of a fictional - * character (skill, power, character points, advantage, disadvantage). - * - * @var Thing [schema.org types: Thing] - */ - public $characterAttribute; - /** - * Cheat codes to the game. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $cheatCode; - /** - * A season that is part of the media series. Supersedes season. - * - * @var CreativeWorkSeason [schema.org types: CreativeWorkSeason] - */ - public $containsSeason; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * An episode of a tv, radio or game media within a series or season. - * Supersedes episodes. - * - * @var Episode [schema.org types: Episode] - */ - public $episode; - /** - * An item is an object within the game world that can be collected by a - * player or, occasionally, a non-player character. - * - * @var Thing [schema.org types: Thing] - */ - public $gameItem; - /** - * Real or fictional location of the game (or part of game). - * - * @var mixed|Place|PostalAddress|string [schema.org types: Place, PostalAddress, URL] - */ - public $gameLocation; - /** - * The electronic systems used to play video games. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $gamePlatform; - /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * The number of episodes in this season or series. - * - * @var int [schema.org types: Integer] - */ - public $numberOfEpisodes; - /** - * Indicate how many people can play this game (minimum, maximum, or range). - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] + * @inheritdoc */ - public $numberOfPlayers; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'characterAttribute' => 'A piece of data that represents a particular aspect of a fictional character (skill, power, character points, advantage, disadvantage).', + 'cheatCode' => 'Cheat codes to the game.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'containsSeason' => 'A season that is part of the media series.', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'episode' => 'An episode of a tv, radio or game media within a series or season.', + 'episodes' => 'An episode of a TV/radio series or season.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'gameItem' => 'An item is an object within the game world that can be collected by a player or, occasionally, a non-player character.', + 'gameLocation' => 'Real or fictional location of the game (or part of game).', + 'gamePlatform' => 'The electronic systems used to play video games.', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + 'numberOfEpisodes' => 'The number of episodes in this season or series.', + 'numberOfPlayers' => 'Indicate how many people can play this game (minimum, maximum, or range).', + 'numberOfSeasons' => 'The number of seasons in this series.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playMode' => 'Indicates whether this game is multi-player, co-op or single-player. The game can be marked as multi-player, co-op and single-player at the same time.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'quest' => 'The task that a player-controlled character, or group of characters may complete in order to gain a reward.', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'season' => 'A season in a media series.', + 'seasons' => 'A season in a media series.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'trailer' => 'The trailer of a movie or tv/radio series, season, episode, etc.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The number of seasons in this series. - * - * @var int [schema.org types: Integer] - */ - public $numberOfSeasons; - /** - * Indicates whether this game is multi-player, co-op or single-player. The - * game can be marked as multi-player, co-op and single-player at the same - * time. - * - * @var GamePlayMode [schema.org types: GamePlayMode] - */ - public $playMode; - /** - * The production company or studio responsible for the item e.g. series, - * video game, episode etc. - * - * @var Organization [schema.org types: Organization] - */ - public $productionCompany; - /** - * The task that a player-controlled character, or group of characters may - * complete in order to gain a reward. - * - * @var Thing [schema.org types: Thing] - */ - public $quest; /** - * The trailer of a movie or tv/radio series, season, episode, etc. - * - * @var VideoObject [schema.org types: VideoObject] + * @inheritdoc */ - public $trailer; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'characterAttribute', 'cheatCode', 'containsSeason', 'director', 'episode', 'gameItem', 'gameLocation', 'gamePlatform', 'musicBy', 'numberOfEpisodes', 'numberOfPlayers', 'numberOfSeasons', 'playMode', 'productionCompany', 'quest', 'trailer'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VideoGameSeriesInterface.php b/src/models/jsonld/VideoGameSeriesInterface.php new file mode 100644 index 000000000..cafd799ae --- /dev/null +++ b/src/models/jsonld/VideoGameSeriesInterface.php @@ -0,0 +1,24 @@ +video + * games. + * + * @var string|Text|URL|Thing + */ + public $gamePlatform; + + /** + * The number of seasons in this series. + * + * @var int|Integer + */ + public $numberOfSeasons; + + /** + * The composer of the soundtrack. + * + * @var Person|MusicGroup + */ + public $musicBy; + + /** + * Indicate how many people can play this game (minimum, maximum, or range). + * + * @var QuantitativeValue + */ + public $numberOfPlayers; + + /** + * The task that a player-controlled character, or group of characters may + * complete in order to gain a reward. + * + * @var Thing + */ + public $quest; + + /** + * Real or fictional location of the game (or part of game). + * + * @var Place|URL|PostalAddress + */ + public $gameLocation; + + /** + * An episode of a tv, radio or game media within a series or season. + * + * @var Episode + */ + public $episode; + + /** + * A director of e.g. tv, radio, movie, video games etc. content. Directors + * can be associated with individual items or with a series, episode, clip. + * + * @var Person + */ + public $directors; + +} diff --git a/src/models/jsonld/VideoGameTrait.php b/src/models/jsonld/VideoGameTrait.php new file mode 100644 index 000000000..16e3e3cc0 --- /dev/null +++ b/src/models/jsonld/VideoGameTrait.php @@ -0,0 +1,120 @@ +video + * games. + * + * @var string|Text|URL|Thing + */ + public $gamePlatform; + + /** + * The composer of the soundtrack. + * + * @var Person|MusicGroup + */ + public $musicBy; + + /** + * A director of e.g. tv, radio, movie, video games etc. content. Directors + * can be associated with individual items or with a series, episode, clip. + * + * @var Person + */ + public $directors; + +} diff --git a/src/models/jsonld/VideoObject.php b/src/models/jsonld/VideoObject.php index d4659a34b..6cf9852b0 100644 --- a/src/models/jsonld/VideoObject.php +++ b/src/models/jsonld/VideoObject.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'caption' => ['Text', 'MediaObject'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'embeddedTextCaption' => ['Text'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnail' => ['ImageObject'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'transcript' => ['Text'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'videoFrameSize' => ['Text'], + 'videoQuality' => ['Text'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actor', - 'caption', - 'director', - 'musicBy', - 'thumbnail', - 'transcript', - 'videoFrameSize', - 'videoQuality' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actor' => ['Person'], - 'caption' => ['MediaObject', 'Text'], - 'director' => ['Person'], - 'musicBy' => ['MusicGroup', 'Person'], - 'thumbnail' => ['ImageObject'], - 'transcript' => ['Text'], - 'videoFrameSize' => ['Text'], - 'videoQuality' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. Supersedes actors.', - 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the encodingFormat.', - '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. Supersedes directors.', - 'musicBy' => 'The composer of the soundtrack.', - 'thumbnail' => 'Thumbnail image for an image or video.', - 'transcript' => 'If this MediaObject is an AudioObject or VideoObject, the transcript of that object.', - 'videoFrameSize' => 'The frame size of the video.', - 'videoQuality' => 'The quality of the video.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The caption for this object. For downloadable machine formats (closed - * caption, subtitles etc.) use MediaObject and indicate the encodingFormat. - * - * @var mixed|MediaObject|string [schema.org types: MediaObject, Text] - */ - public $caption; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $director; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]].', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'embeddedTextCaption' => 'Represents textual captioning from a [[MediaObject]], e.g. text of a \'meme\'.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnail' => 'Thumbnail image for an image or video.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'transcript' => 'If this MediaObject is an AudioObject or VideoObject, the transcript of that object.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'videoFrameSize' => 'The frame size of the video.', + 'videoQuality' => 'The quality of the video.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The composer of the soundtrack. - * - * @var mixed|MusicGroup|Person [schema.org types: MusicGroup, Person] - */ - public $musicBy; - /** - * Thumbnail image for an image or video. - * - * @var ImageObject [schema.org types: ImageObject] - */ - public $thumbnail; - /** - * If this MediaObject is an AudioObject or VideoObject, the transcript of - * that object. - * - * @var string [schema.org types: Text] - */ - public $transcript; /** - * The frame size of the video. - * - * @var string [schema.org types: Text] - */ - public $videoFrameSize; - /** - * The quality of the video. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $videoQuality; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actor', 'caption', 'director', 'musicBy', 'thumbnail', 'transcript', 'videoFrameSize', 'videoQuality'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VideoObjectInterface.php b/src/models/jsonld/VideoObjectInterface.php new file mode 100644 index 000000000..d88f309b8 --- /dev/null +++ b/src/models/jsonld/VideoObjectInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'actor' => ['Person'], + 'actors' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedArticle' => ['NewsArticle'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'bitrate' => ['Text'], + 'caption' => ['Text', 'MediaObject'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contentSize' => ['Text'], + 'contentUrl' => ['URL'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'director' => ['Person'], + 'directors' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'duration' => ['Duration'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'embedUrl' => ['URL'], + 'embeddedTextCaption' => ['Text'], + 'encodesCreativeWork' => ['CreativeWork'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'endTime' => ['DateTime', 'Time'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'ineligibleRegion' => ['Place', 'Text', 'GeoShape'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'musicBy' => ['Person', 'MusicGroup'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'playerType' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'productionCompany' => ['Organization'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'regionsAllowed' => ['Place'], + 'releasedEvent' => ['PublicationEvent'], + 'requiresSubscription' => ['MediaSubscription', 'Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'sha256' => ['Text'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnail' => ['ImageObject'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'transcript' => ['Text'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'uploadDate' => ['Date'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'videoFrameSize' => ['Text'], + 'videoQuality' => ['Text'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'actors' => 'An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedArticle' => 'A NewsArticle associated with the Media Object.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'bitrate' => 'The bitrate of the media object.', + 'caption' => 'The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]].', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contentSize' => 'File size in (mega/kilo) bytes.', + 'contentUrl' => 'Actual bytes of the media object, for example the image file or video file.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'directors' => 'A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'embedUrl' => 'A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.', + 'embeddedTextCaption' => 'Represents textual captioning from a [[MediaObject]], e.g. text of a \'meme\'.', + 'encodesCreativeWork' => 'The CreativeWork encoded by this media object.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'ineligibleRegion' => 'The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]]. ', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'musicBy' => 'The composer of the soundtrack.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'playerType' => 'Player type required—for example, Flash or Silverlight.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + 'productionCompany' => 'The production company or studio responsible for the item e.g. series, video game, episode etc.', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'regionsAllowed' => 'The regions where the media is allowed. If not specified, then it\'s assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requiresSubscription' => 'Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had \'yes\', \'no\').', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'sha256' => 'The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value \'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\'', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnail' => 'Thumbnail image for an image or video.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'transcript' => 'If this MediaObject is an AudioObject or VideoObject, the transcript of that object.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'uploadDate' => 'Date when this media object was uploaded to this site.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'videoFrameSize' => 'The frame size of the video.', + 'videoQuality' => 'The quality of the video.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/VideoObjectSnapshotInterface.php b/src/models/jsonld/VideoObjectSnapshotInterface.php new file mode 100644 index 000000000..2a23c9fe9 --- /dev/null +++ b/src/models/jsonld/VideoObjectSnapshotInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ViewActionInterface.php b/src/models/jsonld/ViewActionInterface.php new file mode 100644 index 000000000..33b775009 --- /dev/null +++ b/src/models/jsonld/ViewActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VinylFormatInterface.php b/src/models/jsonld/VinylFormatInterface.php new file mode 100644 index 000000000..698025b8b --- /dev/null +++ b/src/models/jsonld/VinylFormatInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/ViolenceConsiderationInterface.php b/src/models/jsonld/ViolenceConsiderationInterface.php new file mode 100644 index 000000000..1c568279c --- /dev/null +++ b/src/models/jsonld/ViolenceConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalType', - 'alternateName', - 'description', - 'disambiguatingDescription', - 'identifier', - 'image', - 'mainEntityOfPage', - 'name', - 'potentialAction', - 'sameAs', - 'subjectOf', - 'url' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalType' => ['URL'], - 'alternateName' => ['Text'], - 'description' => ['Text'], - 'disambiguatingDescription' => ['Text'], - 'identifier' => ['PropertyValue', 'Text', 'URL'], - 'image' => ['ImageObject', 'URL'], - 'mainEntityOfPage' => ['CreativeWork', 'URL'], - 'name' => ['Text'], - 'potentialAction' => ['Action'], - 'sameAs' => ['URL'], - 'subjectOf' => ['CreativeWork', 'Event'], - 'url' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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.', - 'alternateName' => 'An alias for the item.', - 'description' => 'A description of the item.', - '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.', - '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 for more details.', - 'image' => 'An image of the item. This can be a URL or a fully described ImageObject.', - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See background notes for details. Inverse property: mainEntity.', - 'name' => 'The name of the item.', - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', - '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.', - 'subjectOf' => 'A CreativeWork or Event about this Thing. Inverse property: about.', - 'url' => 'URL of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $additionalType; /** - * An alias for the item. - * - * @var string [schema.org types: Text] - */ - public $alternateName; - /** - * A description of the item. - * - * @var string [schema.org types: Text] - */ - public $description; - /** - * 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. - * - * @var string [schema.org types: Text] - */ - public $disambiguatingDescription; - /** - * 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 for more details. - * - * @var mixed|PropertyValue|string|string [schema.org types: PropertyValue, Text, URL] - */ - public $identifier; - /** - * An image of the item. This can be a URL or a fully described ImageObject. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $image; - /** - * Indicates a page (or other CreativeWork) for which this thing is the main - * entity being described. See background notes for details. Inverse property: - * mainEntity. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $mainEntityOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The name of the item. - * - * @var string [schema.org types: Text] - */ - public $name; - /** - * Indicates a potential Action, which describes an idealized action in which - * this thing would play an 'object' role. - * - * @var Action [schema.org types: Action] - */ - public $potentialAction; - /** - * 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. - * - * @var string [schema.org types: URL] - */ - public $sameAs; - /** - * A CreativeWork or Event about this Thing. Inverse property: about. - * - * @var mixed|CreativeWork|Event [schema.org types: CreativeWork, Event] - */ - public $subjectOf; /** - * URL of the item. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $url; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'subjectOf', 'url'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VirtualLocationInterface.php b/src/models/jsonld/VirtualLocationInterface.php new file mode 100644 index 000000000..2a6be6e50 --- /dev/null +++ b/src/models/jsonld/VirtualLocationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VirusInterface.php b/src/models/jsonld/VirusInterface.php new file mode 100644 index 000000000..c6397835b --- /dev/null +++ b/src/models/jsonld/VirusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'actor' => ['Person'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'attendee' => ['Person', 'Organization'], + 'attendees' => ['Person', 'Organization'], + 'audience' => ['Audience'], + 'composer' => ['Organization', 'Person'], + 'contributor' => ['Organization', 'Person'], + 'description' => ['Text'], + 'director' => ['Person'], + 'disambiguatingDescription' => ['Text'], + 'doorTime' => ['Time', 'DateTime'], + 'duration' => ['Duration'], + 'endDate' => ['Date', 'DateTime'], + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], + 'eventSchedule' => ['Schedule'], + 'eventStatus' => ['EventStatusType'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'isAccessibleForFree' => ['Boolean'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'maximumPhysicalAttendeeCapacity' => ['Integer'], + 'maximumVirtualAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'organizer' => ['Person', 'Organization'], + 'performer' => ['Organization', 'Person'], + 'performers' => ['Person', 'Organization'], + 'potentialAction' => ['Action'], + 'previousStartDate' => ['Date'], + 'recordedIn' => ['CreativeWork'], + 'remainingAttendeeCapacity' => ['Integer'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'sponsor' => ['Organization', 'Person'], + 'startDate' => ['DateTime', 'Date'], + 'subEvent' => ['Event'], + 'subEvents' => ['Event'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'superEvent' => ['Event'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'workFeatured' => ['CreativeWork'], + 'workPerformed' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'actor', - 'aggregateRating', - 'attendee', - 'audience', - 'composer', - 'contributor', - 'director', - 'doorTime', - 'duration', - 'endDate', - 'eventAttendanceMode', - 'eventSchedule', - 'eventStatus', - 'funder', - 'inLanguage', - 'isAccessibleForFree', - 'location', - 'maximumAttendeeCapacity', - 'maximumPhysicalAttendeeCapacity', - 'maximumVirtualAttendeeCapacity', - 'offers', - 'organizer', - 'performer', - 'previousStartDate', - 'recordedIn', - 'remainingAttendeeCapacity', - 'review', - 'sponsor', - 'startDate', - 'subEvent', - 'superEvent', - 'translator', - 'typicalAgeRange', - 'workFeatured', - 'workPerformed' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'actor' => ['Person'], - 'aggregateRating' => ['AggregateRating'], - 'attendee' => ['Organization', 'Person'], - 'audience' => ['Audience'], - 'composer' => ['Organization', 'Person'], - 'contributor' => ['Organization', 'Person'], - 'director' => ['Person'], - 'doorTime' => ['DateTime', 'Time'], - 'duration' => ['Duration'], - 'endDate' => ['Date', 'DateTime'], - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], - 'eventSchedule' => ['Schedule'], - 'eventStatus' => ['EventStatusType'], - 'funder' => ['Organization', 'Person'], - 'inLanguage' => ['Language', 'Text'], - 'isAccessibleForFree' => ['Boolean'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'maximumAttendeeCapacity' => ['Integer'], - 'maximumPhysicalAttendeeCapacity' => ['Integer'], - 'maximumVirtualAttendeeCapacity' => ['Integer'], - 'offers' => ['Demand', 'Offer'], - 'organizer' => ['Organization', 'Person'], - 'performer' => ['Organization', 'Person'], - 'previousStartDate' => ['Date'], - 'recordedIn' => ['CreativeWork'], - 'remainingAttendeeCapacity' => ['Integer'], - 'review' => ['Review'], - 'sponsor' => ['Organization', 'Person'], - 'startDate' => ['Date', 'DateTime'], - 'subEvent' => ['Event'], - 'superEvent' => ['Event'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'workFeatured' => ['CreativeWork'], - 'workPerformed' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - '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. Supersedes actors.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'attendee' => 'A person or organization attending the event. Supersedes attendees.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - '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. Supersedes directors.', - 'doorTime' => 'The time admission will commence.', - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.', - 'endDate' => 'The end date and time of the item (in ISO 8601 date format).', - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', - '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.', - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - '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. See also availableLanguage. Supersedes language.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, in the case of a MixedEventAttendanceMode).', - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in the case of a MixedEventAttendanceMode).', - '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. Inverse property: itemOffered.', - 'organizer' => 'An organizer of an Event.', - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor. Supersedes performers.', - '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.', - 'recordedIn' => 'The CreativeWork that captured all or part of this Event. Inverse property: recordedAt.', - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', - 'review' => 'A review of the item. Supersedes reviews.', - '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.', - 'startDate' => 'The start date and time of the item (in ISO 8601 date format).', - '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. Supersedes subEvents. Inverse property: superEvent.', - '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. Inverse property: subEvent.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - '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).', - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * 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. Supersedes actors. - * - * @var Person [schema.org types: Person] - */ - public $actor; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A person or organization attending the event. Supersedes attendees. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $attendee; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; - /** - * The person or organization who wrote a composition, or who is the composer - * of a work performed at some event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $composer; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * 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. Supersedes directors. - * - * @var Person [schema.org types: Person] - */ - public $director; - /** - * The time admission will commence. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $doorTime; - /** - * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 - * date format. - * - * @var Duration [schema.org types: Duration] - */ - public $duration; - /** - * The end date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $endDate; - /** - * The eventAttendanceMode of an event indicates whether it occurs online, - * offline, or a mix. - * - * @var EventAttendanceModeEnumeration [schema.org types: EventAttendanceModeEnumeration] - */ - public $eventAttendanceMode; - /** - * 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. - * - * @var Schedule [schema.org types: Schedule] - */ - public $eventSchedule; /** - * An eventStatus of an event represents its status; particularly useful when - * an event is cancelled or rescheduled. - * - * @var EventStatusType [schema.org types: EventStatusType] - */ - public $eventStatus; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OfflineEventAttendanceMode (or the offline aspects, - * in the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumPhysicalAttendeeCapacity; - /** - * The maximum physical attendee capacity of an Event whose - * eventAttendanceMode is OnlineEventAttendanceMode (or the online aspects, in - * the case of a MixedEventAttendanceMode). - * - * @var int [schema.org types: Integer] - */ - public $maximumVirtualAttendeeCapacity; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * An organizer of an Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $organizer; - /** - * A performer at the event—for example, a presenter, musician, musical - * group or actor. Supersedes performers. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $performer; - /** - * 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. - * - * @var Date [schema.org types: Date] - */ - public $previousStartDate; - /** - * The CreativeWork that captured all or part of this Event. Inverse property: - * recordedAt. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $recordedIn; - /** - * The number of attendee places for an event that remain unallocated. - * - * @var int [schema.org types: Integer] - */ - public $remainingAttendeeCapacity; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The start date and time of the item (in ISO 8601 date format). - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $startDate; - /** - * 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. - * Supersedes subEvents. Inverse property: superEvent. - * - * @var Event [schema.org types: Event] + * @inheritdoc */ - public $subEvent; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + '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.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'attendee' => 'A person or organization attending the event.', + 'attendees' => 'A person attending the event.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'description' => 'A description of the item.', + '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.', + '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.', + 'doorTime' => 'The time admission will commence.', + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', + '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.', + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + '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.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', + 'name' => 'The name of the item.', + '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. ', + 'organizer' => 'An organizer of an Event.', + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', + 'review' => 'A review of the item.', + '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.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + '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.', + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + '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.', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + '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).', + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * 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. Inverse property: subEvent. - * - * @var Event [schema.org types: Event] - */ - public $superEvent; /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] - */ - public $typicalAgeRange; - /** - * 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). - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workFeatured; - /** - * A work performed in some event, for example a play performed in a - * TheaterEvent. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workPerformed; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'actor', 'aggregateRating', 'attendee', 'audience', 'composer', 'contributor', 'director', 'doorTime', 'duration', 'endDate', 'eventAttendanceMode', 'eventSchedule', 'eventStatus', 'funder', 'inLanguage', 'isAccessibleForFree', 'location', 'maximumAttendeeCapacity', 'maximumPhysicalAttendeeCapacity', 'maximumVirtualAttendeeCapacity', 'offers', 'organizer', 'performer', 'previousStartDate', 'recordedIn', 'remainingAttendeeCapacity', 'review', 'sponsor', 'startDate', 'subEvent', 'superEvent', 'translator', 'typicalAgeRange', 'workFeatured', 'workPerformed'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VisualArtsEventInterface.php b/src/models/jsonld/VisualArtsEventInterface.php new file mode 100644 index 000000000..fcae1f24b --- /dev/null +++ b/src/models/jsonld/VisualArtsEventInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'artEdition' => ['Integer', 'Text'], + 'artMedium' => ['URL', 'Text'], + 'artform' => ['Text', 'URL'], + 'artist' => ['Person'], + 'artworkSurface' => ['URL', 'Text'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'colorist' => ['Person'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'depth' => ['Distance', 'QuantitativeValue'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'height' => ['Distance', 'QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'inker' => ['Person'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'letterer' => ['Person'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'penciler' => ['Person'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'surface' => ['URL', 'Text'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'width' => ['QuantitativeValue', 'Distance'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'artEdition', - 'artMedium', - 'artform', - 'artist', - 'artworkSurface', - 'colorist', - 'depth', - 'height', - 'inker', - 'letterer', - 'penciler', - 'width' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'artEdition' => ['Integer', 'Text'], - 'artMedium' => ['Text', 'URL'], - 'artform' => ['Text', 'URL'], - 'artist' => ['Person'], - 'artworkSurface' => ['Text', 'URL'], - 'colorist' => ['Person'], - 'depth' => ['Distance', 'QuantitativeValue'], - 'height' => ['Distance', 'QuantitativeValue'], - 'inker' => ['Person'], - 'letterer' => ['Person'], - 'penciler' => ['Person'], - 'width' => ['Distance', 'QuantitativeValue'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'artEdition' => 'The number of copies when multiple copies of a piece of artwork are produced - e.g. for a limited edition of 20 prints, \'artEdition\' refers to the total number of copies (in this example "20").', - 'artMedium' => 'The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.)', - 'artform' => 'e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, etc.', - 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', - 'artworkSurface' => 'The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, etc. Supersedes surface.', - 'colorist' => 'The individual who adds color to inked drawings.', - 'depth' => 'The depth of the item.', - 'height' => 'The height of the item.', - 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', - 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', - 'penciler' => 'The individual who draws the primary narrative artwork.', - 'width' => 'The width of the item.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The number of copies when multiple copies of a piece of artwork are - * produced - e.g. for a limited edition of 20 prints, 'artEdition' refers to - * the total number of copies (in this example "20"). - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $artEdition; /** - * The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, - * Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, - * Pencil, Mixed Media, etc.) - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $artMedium; - /** - * e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, - * etc. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $artform; - /** - * The primary artist for a work in a medium other than pencils or digital - * line art--for example, if the primary artwork is done in watercolors or - * digital paints. - * - * @var Person [schema.org types: Person] - */ - public $artist; - /** - * The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, - * etc. Supersedes surface. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $artworkSurface; - /** - * The individual who adds color to inked drawings. - * - * @var Person [schema.org types: Person] - */ - public $colorist; - /** - * The depth of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] + * @inheritdoc */ - public $depth; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'artEdition' => 'The number of copies when multiple copies of a piece of artwork are produced - e.g. for a limited edition of 20 prints, \'artEdition\' refers to the total number of copies (in this example "20").', + 'artMedium' => 'The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.)', + 'artform' => 'e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, etc.', + 'artist' => 'The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.', + 'artworkSurface' => 'The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, etc.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'colorist' => 'The individual who adds color to inked drawings.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'depth' => 'The depth of the item.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + 'height' => 'The height of the item.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'inker' => 'The individual who traces over the pencil drawings in ink after pencils are complete.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'letterer' => 'The individual who adds lettering, including speech balloons and sound effects, to artwork.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'penciler' => 'The individual who draws the primary narrative artwork.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'surface' => 'A material used as a surface in some artwork, e.g. Canvas, Paper, Wood, Board, etc.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'width' => 'The width of the item.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The height of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] - */ - public $height; - /** - * The individual who traces over the pencil drawings in ink after pencils are - * complete. - * - * @var Person [schema.org types: Person] - */ - public $inker; - /** - * The individual who adds lettering, including speech balloons and sound - * effects, to artwork. - * - * @var Person [schema.org types: Person] - */ - public $letterer; - /** - * The individual who draws the primary narrative artwork. - * - * @var Person [schema.org types: Person] - */ - public $penciler; /** - * The width of the item. - * - * @var mixed|Distance|QuantitativeValue [schema.org types: Distance, QuantitativeValue] + * @inheritdoc */ - public $width; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['artEdition', 'artMedium', 'artform', 'artist', 'artworkSurface', 'colorist', 'depth', 'height', 'inker', 'letterer', 'penciler', 'width'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VisualArtworkInterface.php b/src/models/jsonld/VisualArtworkInterface.php new file mode 100644 index 000000000..2b0cd659d --- /dev/null +++ b/src/models/jsonld/VisualArtworkInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'associatedAnatomy' => ['AnatomicalStructure', 'AnatomicalSystem', 'SuperficialAnatomy'], + 'code' => ['MedicalCode'], + 'description' => ['Text'], + 'differentialDiagnosis' => ['DDxElement'], + 'disambiguatingDescription' => ['Text'], + 'drug' => ['Drug'], + 'epidemiology' => ['Text'], + 'expectedPrognosis' => ['Text'], + 'funding' => ['Grant'], + 'guideline' => ['MedicalGuideline'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'identifyingExam' => ['PhysicalExam'], + 'identifyingTest' => ['MedicalTest'], + 'image' => ['URL', 'ImageObject'], + 'legalStatus' => ['DrugLegalStatus', 'Text', 'MedicalEnumeration'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'medicineSystem' => ['MedicineSystem'], + 'name' => ['Text'], + 'naturalProgression' => ['Text'], + 'pathophysiology' => ['Text'], + 'possibleComplication' => ['Text'], + 'possibleTreatment' => ['MedicalTherapy'], + 'potentialAction' => ['Action'], + 'primaryPrevention' => ['MedicalTherapy'], + 'recognizingAuthority' => ['Organization'], + 'relevantSpecialty' => ['MedicalSpecialty'], + 'riskFactor' => ['MedicalRiskFactor'], + 'sameAs' => ['URL'], + 'secondaryPrevention' => ['MedicalTherapy'], + 'signOrSymptom' => ['MedicalSignOrSymptom'], + 'stage' => ['MedicalConditionStage'], + 'status' => ['Text', 'EventStatusType', 'MedicalStudyStatus'], + 'study' => ['MedicalStudy'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'typicalTest' => ['MedicalTest'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'identifyingExam', - 'identifyingTest' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'identifyingExam' => ['PhysicalExam'], - 'identifyingTest' => ['MedicalTest'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'associatedAnatomy' => 'The anatomy of the underlying organ system or structures associated with this entity.', + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', + 'description' => 'A description of the item.', + 'differentialDiagnosis' => 'One of a set of differential diagnoses for the condition. Specifically, a closely-related or competing diagnosis typically considered later in the cognitive process whereby this medical condition is distinguished from others most likely responsible for a similar collection of signs and symptoms to reach the most parsimonious diagnosis or diagnoses in a patient.', + '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.', + 'drug' => 'Specifying a drug or medicine used in a medication procedure.', + 'epidemiology' => 'The characteristics of associated patients, such as age, gender, race etc.', + 'expectedPrognosis' => 'The likely outcome in either the short term or long term of the medical condition.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'guideline' => 'A medical guideline related to this entity.', + '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. ', + 'identifyingExam' => 'A physical examination that can identify this sign.', + 'identifyingTest' => 'A diagnostic test that can identify this sign.', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', + '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.', + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', + 'name' => 'The name of the item.', + 'naturalProgression' => 'The expected progression of the condition if it is not treated and allowed to progress naturally.', + 'pathophysiology' => 'Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition.', + 'possibleComplication' => 'A possible unexpected and unfavorable evolution of a medical condition. Complications may include worsening of the signs or symptoms of the disease, extension of the condition to other organ systems, etc.', + 'possibleTreatment' => 'A possible treatment to address this condition, sign or symptom.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryPrevention' => 'A preventative therapy used to prevent an initial occurrence of the medical condition, such as vaccination.', + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', + 'riskFactor' => 'A modifiable or non-modifiable factor that increases the risk of a patient contracting this condition, e.g. age, coexisting condition.', + '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.', + 'secondaryPrevention' => 'A preventative therapy used to prevent reoccurrence of the medical condition after an initial episode of the condition.', + 'signOrSymptom' => 'A sign or symptom of this condition. Signs are objective or physically observable manifestations of the medical condition while symptoms are the subjective experience of the medical condition.', + 'stage' => 'The stage of the condition, if applicable.', + 'status' => 'The status of the study (enumerated).', + 'study' => 'A medical study or trial related to this entity.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'typicalTest' => 'A medical test typically performed given this condition.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'identifyingExam' => 'A physical examination that can identify this sign.', - 'identifyingTest' => 'A diagnostic test that can identify this sign.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A physical examination that can identify this sign. - * - * @var PhysicalExam [schema.org types: PhysicalExam] - */ - public $identifyingExam; - /** - * A diagnostic test that can identify this sign. - * - * @var MedicalTest [schema.org types: MedicalTest] + * @inheritdoc */ - public $identifyingTest; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['identifyingExam', 'identifyingTest'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VitalSignInterface.php b/src/models/jsonld/VitalSignInterface.php new file mode 100644 index 000000000..11c9aa764 --- /dev/null +++ b/src/models/jsonld/VitalSignInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number. The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations. The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number. The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. The Global Location Number (GLN, sometimes also - * referred to as International Location Number or ILN) of the respective - * organization, person, or place. The GLN is a 13-digit number used to - * identify parties and physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VolcanoInterface.php b/src/models/jsonld/VolcanoInterface.php new file mode 100644 index 000000000..2b6fca01c --- /dev/null +++ b/src/models/jsonld/VolcanoInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionOption' => ['Thing', 'Text'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'candidate' => ['Person'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'option' => ['Text', 'Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'candidate' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionOption' => 'A sub property of object. The options subject to this action.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'candidate' => 'A sub property of object. The candidate subject of this action.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'option' => 'A sub property of object. The options subject to this action.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'candidate' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'candidate' => 'A sub property of object. The candidate subject of this action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of object. The candidate subject of this action. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $candidate; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['candidate'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/VoteActionInterface.php b/src/models/jsonld/VoteActionInterface.php new file mode 100644 index 000000000..902e365d3 --- /dev/null +++ b/src/models/jsonld/VoteActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'cssSelector' => ['CssSelectorType'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'xpath' => ['XPathType'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cssSelector', - 'xpath' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'cssSelector' => ['CssSelectorType'], - 'xpath' => ['XPathType'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'cssSelector' => 'A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'xpath' => 'An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cssSelector' => 'A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', - 'xpath' => 'An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the - * latter case, multiple matches within a page can constitute a single - * conceptual "Web page element". - * - * @var CssSelectorType [schema.org types: CssSelectorType] - */ - public $cssSelector; - /** - * An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter - * case, multiple matches within a page can constitute a single conceptual - * "Web page element". - * - * @var XPathType [schema.org types: XPathType] + * @inheritdoc */ - public $xpath; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cssSelector', 'xpath'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WPAdBlockInterface.php b/src/models/jsonld/WPAdBlockInterface.php new file mode 100644 index 000000000..a85ea5956 --- /dev/null +++ b/src/models/jsonld/WPAdBlockInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'cssSelector' => ['CssSelectorType'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'xpath' => ['XPathType'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cssSelector', - 'xpath' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'cssSelector' => ['CssSelectorType'], - 'xpath' => ['XPathType'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'cssSelector' => 'A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'xpath' => 'An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cssSelector' => 'A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', - 'xpath' => 'An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the - * latter case, multiple matches within a page can constitute a single - * conceptual "Web page element". - * - * @var CssSelectorType [schema.org types: CssSelectorType] - */ - public $cssSelector; - /** - * An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter - * case, multiple matches within a page can constitute a single conceptual - * "Web page element". - * - * @var XPathType [schema.org types: XPathType] + * @inheritdoc */ - public $xpath; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cssSelector', 'xpath'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WPFooterInterface.php b/src/models/jsonld/WPFooterInterface.php new file mode 100644 index 000000000..1c9a02b6d --- /dev/null +++ b/src/models/jsonld/WPFooterInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'cssSelector' => ['CssSelectorType'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'xpath' => ['XPathType'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cssSelector', - 'xpath' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'cssSelector' => ['CssSelectorType'], - 'xpath' => ['XPathType'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'cssSelector' => 'A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'xpath' => 'An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cssSelector' => 'A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', - 'xpath' => 'An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the - * latter case, multiple matches within a page can constitute a single - * conceptual "Web page element". - * - * @var CssSelectorType [schema.org types: CssSelectorType] - */ - public $cssSelector; - /** - * An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter - * case, multiple matches within a page can constitute a single conceptual - * "Web page element". - * - * @var XPathType [schema.org types: XPathType] + * @inheritdoc */ - public $xpath; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cssSelector', 'xpath'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WPHeaderInterface.php b/src/models/jsonld/WPHeaderInterface.php new file mode 100644 index 000000000..bf23d5235 --- /dev/null +++ b/src/models/jsonld/WPHeaderInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'cssSelector' => ['CssSelectorType'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'xpath' => ['XPathType'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cssSelector', - 'xpath' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'cssSelector' => ['CssSelectorType'], - 'xpath' => ['XPathType'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'cssSelector' => 'A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'xpath' => 'An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cssSelector' => 'A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', - 'xpath' => 'An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the - * latter case, multiple matches within a page can constitute a single - * conceptual "Web page element". - * - * @var CssSelectorType [schema.org types: CssSelectorType] - */ - public $cssSelector; - /** - * An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter - * case, multiple matches within a page can constitute a single conceptual - * "Web page element". - * - * @var XPathType [schema.org types: XPathType] + * @inheritdoc */ - public $xpath; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cssSelector', 'xpath'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WPSideBarInterface.php b/src/models/jsonld/WPSideBarInterface.php new file mode 100644 index 000000000..1474e96fd --- /dev/null +++ b/src/models/jsonld/WPSideBarInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionStatus', - 'agent', - 'endTime', - 'error', - 'instrument', - 'location', - 'object', - 'participant', - 'result', - 'startTime', - 'target' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionStatus' => ['ActionStatusType'], - 'agent' => ['Organization', 'Person'], - 'endTime' => ['DateTime', 'Time'], - 'error' => ['Thing'], - 'instrument' => ['Thing'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'object' => ['Thing'], - 'participant' => ['Organization', 'Person'], - 'result' => ['Thing'], - 'startTime' => ['DateTime', 'Time'], - 'target' => ['EntryPoint'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionStatus' => 'Indicates the current disposition of the Action.', - 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. John wrote a book.', - 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'error' => 'For failed actions, more information on the cause of the failure.', - 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with a pen.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read a book.', - 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with Steve.', - 'result' => 'The result produced in the action. e.g. John wrote a book.', - 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', - 'target' => 'Indicates a target EntryPoint for an Action.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates the current disposition of the Action. - * - * @var ActionStatusType [schema.org types: ActionStatusType] - */ - public $actionStatus; - /** - * The direct performer or driver of the action (animate or inanimate). e.g. - * John wrote a book. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $agent; - /** - * The endTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to end. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the end of a clip within a larger file. Note - * that Event uses startDate/endDate instead of startTime/endTime, even when - * describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $endTime; - /** - * For failed actions, more information on the cause of the failure. - * - * @var Thing [schema.org types: Thing] - */ - public $error; - /** - * The object that helped the agent perform the action. e.g. John wrote a book - * with a pen. - * - * @var Thing [schema.org types: Thing] - */ - public $instrument; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] + * @inheritdoc */ - public $location; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The object upon which the action is carried out, whose state is kept intact - * or changed. Also known as the semantic roles patient, affected or undergoer - * (which change their state) or theme (which doesn't). e.g. John read a book. - * - * @var Thing [schema.org types: Thing] - */ - public $object; - /** - * Other co-agents that participated in the action indirectly. e.g. John wrote - * a book with Steve. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $participant; - /** - * The result produced in the action. e.g. John wrote a book. - * - * @var Thing [schema.org types: Thing] - */ - public $result; - /** - * The startTime of something. For a reserved event or service (e.g. - * FoodEstablishmentReservation), the time that it is expected to start. For - * actions that span a period of time, when the action was performed. e.g. - * John wrote a book from January to December. For media, including audio and - * video, it's the time offset of the start of a clip within a larger file. - * Note that Event uses startDate/endDate instead of startTime/endTime, even - * when describing dates with times. This situation may be clarified in future - * revisions. - * - * @var mixed|DateTime|Time [schema.org types: DateTime, Time] - */ - public $startTime; /** - * Indicates a target EntryPoint for an Action. - * - * @var EntryPoint [schema.org types: EntryPoint] + * @inheritdoc */ - public $target; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionStatus', 'agent', 'endTime', 'error', 'instrument', 'location', 'object', 'participant', 'result', 'startTime', 'target'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WantActionInterface.php b/src/models/jsonld/WantActionInterface.php new file mode 100644 index 000000000..a70489a8c --- /dev/null +++ b/src/models/jsonld/WantActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'durationOfWarranty' => ['QuantitativeValue'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'url' => ['URL'], + 'warrantyScope' => ['WarrantyScope'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'durationOfWarranty', - 'warrantyScope' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'durationOfWarranty' => ['QuantitativeValue'], - 'warrantyScope' => ['WarrantyScope'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'durationOfWarranty' => 'The duration of the warranty promise. Common unitCode values are ANN for year, MON for months, or DAY for days.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'url' => 'URL of the item.', + 'warrantyScope' => 'The scope of the warranty promise.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'durationOfWarranty' => 'The duration of the warranty promise. Common unitCode values are ANN for year, MON for months, or DAY for days.', - 'warrantyScope' => 'The scope of the warranty promise.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The duration of the warranty promise. Common unitCode values are ANN for - * year, MON for months, or DAY for days. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $durationOfWarranty; - /** - * The scope of the warranty promise. - * - * @var WarrantyScope [schema.org types: WarrantyScope] + * @inheritdoc */ - public $warrantyScope; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['durationOfWarranty', 'warrantyScope'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WarrantyPromiseInterface.php b/src/models/jsonld/WarrantyPromiseInterface.php new file mode 100644 index 000000000..b3a43c7fb --- /dev/null +++ b/src/models/jsonld/WarrantyPromiseInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WarrantyScopeInterface.php b/src/models/jsonld/WarrantyScopeInterface.php new file mode 100644 index 000000000..a249c0886 --- /dev/null +++ b/src/models/jsonld/WarrantyScopeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WatchActionInterface.php b/src/models/jsonld/WatchActionInterface.php new file mode 100644 index 000000000..b2cd44b1a --- /dev/null +++ b/src/models/jsonld/WatchActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'additionalProperty', - 'address', - 'aggregateRating', - 'amenityFeature', - 'branchCode', - 'containedInPlace', - 'containsPlace', - 'event', - 'faxNumber', - 'geo', - 'geoContains', - 'geoCoveredBy', - 'geoCovers', - 'geoCrosses', - 'geoDisjoint', - 'geoEquals', - 'geoIntersects', - 'geoOverlaps', - 'geoTouches', - 'geoWithin', - 'globalLocationNumber', - 'hasDriveThroughService', - 'hasMap', - 'isAccessibleForFree', - 'isicV4', - 'latitude', - 'logo', - 'longitude', - 'maximumAttendeeCapacity', - 'openingHoursSpecification', - 'photo', - 'publicAccess', - 'review', - 'slogan', - 'smokingAllowed', - 'specialOpeningHoursSpecification', - 'telephone', - 'tourBookingPage' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'additionalProperty' => ['PropertyValue'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'amenityFeature' => ['LocationFeatureSpecification'], - 'branchCode' => ['Text'], - 'containedInPlace' => ['Place'], - 'containsPlace' => ['Place'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'geo' => ['GeoCoordinates', 'GeoShape'], - 'geoContains' => ['GeospatialGeometry', 'Place'], - 'geoCoveredBy' => ['GeospatialGeometry', 'Place'], - 'geoCovers' => ['GeospatialGeometry', 'Place'], - 'geoCrosses' => ['GeospatialGeometry', 'Place'], - 'geoDisjoint' => ['GeospatialGeometry', 'Place'], - 'geoEquals' => ['GeospatialGeometry', 'Place'], - 'geoIntersects' => ['GeospatialGeometry', 'Place'], - 'geoOverlaps' => ['GeospatialGeometry', 'Place'], - 'geoTouches' => ['GeospatialGeometry', 'Place'], - 'geoWithin' => ['GeospatialGeometry', 'Place'], - 'globalLocationNumber' => ['Text'], - 'hasDriveThroughService' => ['Boolean'], - 'hasMap' => ['Map', 'URL'], - 'isAccessibleForFree' => ['Boolean'], - 'isicV4' => ['Text'], - 'latitude' => ['Number', 'Text'], - 'logo' => ['ImageObject', 'URL'], - 'longitude' => ['Number', 'Text'], - 'maximumAttendeeCapacity' => ['Integer'], - 'openingHoursSpecification' => ['OpeningHoursSpecification'], - 'photo' => ['ImageObject', 'Photograph'], - 'publicAccess' => ['Boolean'], - 'review' => ['Review'], - 'slogan' => ['Text'], - 'smokingAllowed' => ['Boolean'], - 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], - 'telephone' => ['Text'], - 'tourBookingPage' => ['URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', - 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.', - 'containedInPlace' => 'The basic containment relation between a place and one that contains it. Supersedes containedIn. Inverse property: containsPlace.', - 'containsPlace' => 'The basic containment relation between a place and another that it contains. Inverse property: containedInPlace.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'geo' => 'The geo coordinates of the place.', - 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in DE-9IM.', - 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in DE-9IM.', - 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in DE-9IM.', - 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in DE-9IM.', - 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in DE-9IM)', - 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in DE-9IM. "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', - 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in DE-9IM.', - 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in DE-9IM.', - 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in DE-9IM )', - 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in DE-9IM.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasDriveThroughService' => 'Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.', - 'hasMap' => 'A URL to a map of the place. Supersedes map, maps.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place. The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'latitude' => 'The latitude of a location. For example 37.42242 (WGS 84).', - 'logo' => 'An associated logo.', - 'longitude' => 'The longitude of a location. For example -122.08585 (WGS 84).', - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', - 'openingHoursSpecification' => 'The opening hours of a certain place.', - 'photo' => 'A photograph of this place. Supersedes photos.', - 'publicAccess' => 'A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value', - 'review' => 'A review of the item. Supersedes reviews.', - 'slogan' => 'A slogan or motto associated with the item.', - 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', - 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.', - 'telephone' => 'The telephone number. The telephone number.', - 'tourBookingPage' => 'A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A property-value pair representing an additional characteristics of the - * entitity, e.g. a product feature or another characteristic for which there - * is no matching property in schema.org. Note: Publishers should be aware - * that applications designed to use specific schema.org properties (e.g. - * http://schema.org/width, http://schema.org/color, http://schema.org/gtin13, - * ...) will typically expect such data to be provided using those properties, - * rather than using the generic property/value mechanism. - * - * @var PropertyValue [schema.org types: PropertyValue] - */ - public $additionalProperty; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * An amenity feature (e.g. a characteristic or service) of the Accommodation. - * This generic property does not make a statement about whether the feature - * is included in an offer for the main accommodation or available at extra - * costs. - * - * @var LocationFeatureSpecification [schema.org types: LocationFeatureSpecification] - */ - public $amenityFeature; - /** - * A short textual code (also called "store code") that uniquely identifies a - * place of business. The code is typically assigned by the parentOrganization - * and used in structured URLs. For example, in the URL - * http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is - * a branchCode for a particular branch. - * - * @var string [schema.org types: Text] - */ - public $branchCode; - /** - * The basic containment relation between a place and one that contains it. - * Supersedes containedIn. Inverse property: containsPlace. - * - * @var Place [schema.org types: Place] - */ - public $containedInPlace; - /** - * The basic containment relation between a place and another that it - * contains. Inverse property: containedInPlace. - * - * @var Place [schema.org types: Place] - */ - public $containsPlace; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * The geo coordinates of the place. - * - * @var mixed|GeoCoordinates|GeoShape [schema.org types: GeoCoordinates, GeoShape] - */ - public $geo; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a containing geometry to a contained geometry. "a - * contains b iff no points of b lie in the exterior of a, and at least one - * point of the interior of b lies in the interior of a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoContains; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that covers it. As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCoveredBy; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a covering geometry to a covered geometry. "Every - * point of b is a point of (the interior or boundary of) a". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCovers; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that crosses it: "a crosses b: - * they have some but not all interior points in common, and the dimension of - * the intersection is less than that of at least one of them". As defined in - * DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoCrosses; /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically disjoint: they have no point in common. They - * form a set of disconnected geometries." (a symmetric relationship, as - * defined in DE-9IM) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoDisjoint; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) are topologically equal, as defined in DE-9IM. "Two geometries - * are topologically equal if their interiors intersect and no part of the - * interior or boundary of one geometry intersects the exterior of the other" - * (a symmetric relationship) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoEquals; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) have at least one point in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoIntersects; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to another that geospatially overlaps it, - * i.e. they have some but not all points in common. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoOverlaps; - /** - * Represents spatial relations in which two geometries (or the places they - * represent) touch: they have at least one boundary point in common, but no - * interior points." (a symmetric relationship, as defined in DE-9IM ) - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoTouches; - /** - * Represents a relationship between two geometries (or the places they - * represent), relating a geometry to one that contains it, i.e. it is inside - * (i.e. within) its interior. As defined in DE-9IM. - * - * @var mixed|GeospatialGeometry|Place [schema.org types: GeospatialGeometry, Place] - */ - public $geoWithin; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * Indicates whether some facility (e.g. FoodEstablishment, - * CovidTestingFacility) offers a service that can be used by driving through - * in a car. In the case of CovidTestingFacility such facilities could - * potentially help with social distancing from other potentially-infected - * users. - * - * @var bool [schema.org types: Boolean] - */ - public $hasDriveThroughService; - /** - * A URL to a map of the place. Supersedes map, maps. - * - * @var mixed|Map|string [schema.org types: Map, URL] - */ - public $hasMap; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. The International Standard of Industrial Classification - * of All Economic Activities (ISIC), Revision 4 code for a particular - * organization, business person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * The latitude of a location. For example 37.42242 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $latitude; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * The longitude of a location. For example -122.08585 (WGS 84). - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $longitude; - /** - * The total number of individuals that may attend an event or venue. - * - * @var int [schema.org types: Integer] - */ - public $maximumAttendeeCapacity; - /** - * The opening hours of a certain place. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $openingHoursSpecification; - /** - * A photograph of this place. Supersedes photos. - * - * @var mixed|ImageObject|Photograph [schema.org types: ImageObject, Photograph] - */ - public $photo; - /** - * A flag to signal that the Place is open to public visitors. If this - * property is omitted there is no assumed default boolean value - * - * @var bool [schema.org types: Boolean] - */ - public $publicAccess; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] + * @inheritdoc */ - public $review; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * Indicates whether it is allowed to smoke in the place, e.g. in the - * restaurant, hotel or hotel room. - * - * @var bool [schema.org types: Boolean] - */ - public $smokingAllowed; - /** - * The special opening hours of a certain place. Use this to explicitly - * override general opening hours brought in scope by - * openingHoursSpecification or openingHours. - * - * @var OpeningHoursSpecification [schema.org types: OpeningHoursSpecification] - */ - public $specialOpeningHoursSpecification; - /** - * The telephone number. The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * A page providing information on how to book a tour of some Place, such as - * an Accommodation or ApartmentComplex in a real estate setting, as well as - * other kinds of tours as appropriate. - * - * @var string [schema.org types: URL] + * @inheritdoc */ - public $tourBookingPage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['additionalProperty', 'address', 'aggregateRating', 'amenityFeature', 'branchCode', 'containedInPlace', 'containsPlace', 'event', 'faxNumber', 'geo', 'geoContains', 'geoCoveredBy', 'geoCovers', 'geoCrosses', 'geoDisjoint', 'geoEquals', 'geoIntersects', 'geoOverlaps', 'geoTouches', 'geoWithin', 'globalLocationNumber', 'hasDriveThroughService', 'hasMap', 'isAccessibleForFree', 'isicV4', 'latitude', 'logo', 'longitude', 'maximumAttendeeCapacity', 'openingHoursSpecification', 'photo', 'publicAccess', 'review', 'slogan', 'smokingAllowed', 'specialOpeningHoursSpecification', 'telephone', 'tourBookingPage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WaterfallInterface.php b/src/models/jsonld/WaterfallInterface.php new file mode 100644 index 000000000..845fe2169 --- /dev/null +++ b/src/models/jsonld/WaterfallInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WeaponConsiderationInterface.php b/src/models/jsonld/WeaponConsiderationInterface.php new file mode 100644 index 000000000..e7dcdd2b7 --- /dev/null +++ b/src/models/jsonld/WeaponConsiderationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'expectsAcceptanceOf' => ['Offer'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionAccessibilityRequirement', - 'expectsAcceptanceOf' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionAccessibilityRequirement' => ['ActionAccessSpecification'], - 'expectsAcceptanceOf' => ['Offer'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionAccessibilityRequirement' => 'A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed.', - 'expectsAcceptanceOf' => 'An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of requirements that a must be fulfilled in order to perform an - * Action. If more than one value is specied, fulfilling one set of - * requirements will allow the Action to be performed. - * - * @var ActionAccessSpecification [schema.org types: ActionAccessSpecification] - */ - public $actionAccessibilityRequirement; - /** - * An Offer which must be accepted before the user can perform the Action. For - * example, the user may need to buy a movie before being able to watch it. - * - * @var Offer [schema.org types: Offer] + * @inheritdoc */ - public $expectsAcceptanceOf; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionAccessibilityRequirement', 'expectsAcceptanceOf'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WearActionInterface.php b/src/models/jsonld/WearActionInterface.php new file mode 100644 index 000000000..ef22a2bcd --- /dev/null +++ b/src/models/jsonld/WearActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementBackInterface.php b/src/models/jsonld/WearableMeasurementBackInterface.php new file mode 100644 index 000000000..270973f4b --- /dev/null +++ b/src/models/jsonld/WearableMeasurementBackInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementChestOrBustInterface.php b/src/models/jsonld/WearableMeasurementChestOrBustInterface.php new file mode 100644 index 000000000..edce81105 --- /dev/null +++ b/src/models/jsonld/WearableMeasurementChestOrBustInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementCollarInterface.php b/src/models/jsonld/WearableMeasurementCollarInterface.php new file mode 100644 index 000000000..af71e0943 --- /dev/null +++ b/src/models/jsonld/WearableMeasurementCollarInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementCupInterface.php b/src/models/jsonld/WearableMeasurementCupInterface.php new file mode 100644 index 000000000..aafcb65cd --- /dev/null +++ b/src/models/jsonld/WearableMeasurementCupInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementHeightInterface.php b/src/models/jsonld/WearableMeasurementHeightInterface.php new file mode 100644 index 000000000..424340ea6 --- /dev/null +++ b/src/models/jsonld/WearableMeasurementHeightInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementHipsInterface.php b/src/models/jsonld/WearableMeasurementHipsInterface.php new file mode 100644 index 000000000..fb6520a08 --- /dev/null +++ b/src/models/jsonld/WearableMeasurementHipsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementInseamInterface.php b/src/models/jsonld/WearableMeasurementInseamInterface.php new file mode 100644 index 000000000..2ab1ea6be --- /dev/null +++ b/src/models/jsonld/WearableMeasurementInseamInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementLengthInterface.php b/src/models/jsonld/WearableMeasurementLengthInterface.php new file mode 100644 index 000000000..daa2327ac --- /dev/null +++ b/src/models/jsonld/WearableMeasurementLengthInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementOutsideLegInterface.php b/src/models/jsonld/WearableMeasurementOutsideLegInterface.php new file mode 100644 index 000000000..203f96cc4 --- /dev/null +++ b/src/models/jsonld/WearableMeasurementOutsideLegInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementSleeveInterface.php b/src/models/jsonld/WearableMeasurementSleeveInterface.php new file mode 100644 index 000000000..69bfb4f89 --- /dev/null +++ b/src/models/jsonld/WearableMeasurementSleeveInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementTypeEnumerationInterface.php b/src/models/jsonld/WearableMeasurementTypeEnumerationInterface.php new file mode 100644 index 000000000..dad9e3dd3 --- /dev/null +++ b/src/models/jsonld/WearableMeasurementTypeEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementWaistInterface.php b/src/models/jsonld/WearableMeasurementWaistInterface.php new file mode 100644 index 000000000..d14a6bea9 --- /dev/null +++ b/src/models/jsonld/WearableMeasurementWaistInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableMeasurementWidthInterface.php b/src/models/jsonld/WearableMeasurementWidthInterface.php new file mode 100644 index 000000000..68646ea12 --- /dev/null +++ b/src/models/jsonld/WearableMeasurementWidthInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupBigInterface.php b/src/models/jsonld/WearableSizeGroupBigInterface.php new file mode 100644 index 000000000..0234c2b8c --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupBigInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupBoysInterface.php b/src/models/jsonld/WearableSizeGroupBoysInterface.php new file mode 100644 index 000000000..4f8095813 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupBoysInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupEnumerationInterface.php b/src/models/jsonld/WearableSizeGroupEnumerationInterface.php new file mode 100644 index 000000000..03d7cf467 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupExtraShortInterface.php b/src/models/jsonld/WearableSizeGroupExtraShortInterface.php new file mode 100644 index 000000000..701e6dc86 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupExtraShortInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupExtraTallInterface.php b/src/models/jsonld/WearableSizeGroupExtraTallInterface.php new file mode 100644 index 000000000..8c2e5cf11 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupExtraTallInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupGirlsInterface.php b/src/models/jsonld/WearableSizeGroupGirlsInterface.php new file mode 100644 index 000000000..ea28226b7 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupGirlsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupHuskyInterface.php b/src/models/jsonld/WearableSizeGroupHuskyInterface.php new file mode 100644 index 000000000..012a83c0f --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupHuskyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupInfantsInterface.php b/src/models/jsonld/WearableSizeGroupInfantsInterface.php new file mode 100644 index 000000000..d37608f11 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupInfantsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupJuniorsInterface.php b/src/models/jsonld/WearableSizeGroupJuniorsInterface.php new file mode 100644 index 000000000..312352f68 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupJuniorsInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupMaternityInterface.php b/src/models/jsonld/WearableSizeGroupMaternityInterface.php new file mode 100644 index 000000000..aaab87973 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupMaternityInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupMensInterface.php b/src/models/jsonld/WearableSizeGroupMensInterface.php new file mode 100644 index 000000000..a730c7ec5 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupMensInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupMissesInterface.php b/src/models/jsonld/WearableSizeGroupMissesInterface.php new file mode 100644 index 000000000..c72c24328 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupMissesInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupPetiteInterface.php b/src/models/jsonld/WearableSizeGroupPetiteInterface.php new file mode 100644 index 000000000..797b6bf78 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupPetiteInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupPlusInterface.php b/src/models/jsonld/WearableSizeGroupPlusInterface.php new file mode 100644 index 000000000..d741f40cb --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupPlusInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupRegularInterface.php b/src/models/jsonld/WearableSizeGroupRegularInterface.php new file mode 100644 index 000000000..9c7a5cf51 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupRegularInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupShortInterface.php b/src/models/jsonld/WearableSizeGroupShortInterface.php new file mode 100644 index 000000000..28641b820 --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupShortInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupTallInterface.php b/src/models/jsonld/WearableSizeGroupTallInterface.php new file mode 100644 index 000000000..bb98a659a --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupTallInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeGroupWomensInterface.php b/src/models/jsonld/WearableSizeGroupWomensInterface.php new file mode 100644 index 000000000..a559f7e2f --- /dev/null +++ b/src/models/jsonld/WearableSizeGroupWomensInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemAUInterface.php b/src/models/jsonld/WearableSizeSystemAUInterface.php new file mode 100644 index 000000000..ff86c6c79 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemAUInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemBRInterface.php b/src/models/jsonld/WearableSizeSystemBRInterface.php new file mode 100644 index 000000000..8fe54daa8 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemBRInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemCNInterface.php b/src/models/jsonld/WearableSizeSystemCNInterface.php new file mode 100644 index 000000000..a816d7738 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemCNInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemContinentalInterface.php b/src/models/jsonld/WearableSizeSystemContinentalInterface.php new file mode 100644 index 000000000..6830724a3 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemContinentalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemDEInterface.php b/src/models/jsonld/WearableSizeSystemDEInterface.php new file mode 100644 index 000000000..de21973cc --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemDEInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemEN13402Interface.php b/src/models/jsonld/WearableSizeSystemEN13402Interface.php new file mode 100644 index 000000000..adc3111a1 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemEN13402Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemEnumerationInterface.php b/src/models/jsonld/WearableSizeSystemEnumerationInterface.php new file mode 100644 index 000000000..d9e49e444 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemEnumerationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemEuropeInterface.php b/src/models/jsonld/WearableSizeSystemEuropeInterface.php new file mode 100644 index 000000000..53aeb49c5 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemEuropeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemFRInterface.php b/src/models/jsonld/WearableSizeSystemFRInterface.php new file mode 100644 index 000000000..d8d4bcb02 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemFRInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemGS1Interface.php b/src/models/jsonld/WearableSizeSystemGS1Interface.php new file mode 100644 index 000000000..21cc8ff42 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemGS1Interface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemITInterface.php b/src/models/jsonld/WearableSizeSystemITInterface.php new file mode 100644 index 000000000..45dc53f0f --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemITInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemJPInterface.php b/src/models/jsonld/WearableSizeSystemJPInterface.php new file mode 100644 index 000000000..50c3dfceb --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemJPInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemMXInterface.php b/src/models/jsonld/WearableSizeSystemMXInterface.php new file mode 100644 index 000000000..c378d4188 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemMXInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemUKInterface.php b/src/models/jsonld/WearableSizeSystemUKInterface.php new file mode 100644 index 000000000..9d933b826 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemUKInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } + + /** + * @inheritdoc + */ + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } + + /** + * @inheritdoc + */ + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } + + /** + * @inheritdoc + */ + public function getGoogleRecommendedSchema(): array + { + return ['image', 'url']; + } + + /** + * @inheritdoc + */ + public function defineRules(): array + { + $rules = parent::defineRules(); + $rules = array_merge($rules, [ + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + ]); + + return $rules; + } +} diff --git a/src/models/jsonld/WearableSizeSystemUSInterface.php b/src/models/jsonld/WearableSizeSystemUSInterface.php new file mode 100644 index 000000000..12cace9a2 --- /dev/null +++ b/src/models/jsonld/WearableSizeSystemUSInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'audience' => ['Audience'], + 'availableChannel' => ['ServiceChannel'], + 'award' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'broker' => ['Person', 'Organization'], + 'category' => ['URL', 'Text', 'PhysicalActivityCategory', 'Thing', 'CategoryCode'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'documentation' => ['CreativeWork', 'URL'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hoursAvailable' => ['OpeningHoursSpecification'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isRelatedTo' => ['Service', 'Product'], + 'isSimilarTo' => ['Service', 'Product'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'produces' => ['Thing'], + 'provider' => ['Organization', 'Person'], + 'providerMobility' => ['Text'], + 'review' => ['Review'], + 'sameAs' => ['URL'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'serviceAudience' => ['Audience'], + 'serviceOutput' => ['Thing'], + 'serviceType' => ['GovernmentBenefitsType', 'Text'], + 'slogan' => ['Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termsOfService' => ['URL', 'Text'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'documentation' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'availableChannel' => 'A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).', + 'award' => 'An award won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + '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.', + 'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.', + 'description' => 'A description of the item.', + '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.', + 'documentation' => 'Further documentation describing the Web API in more detail.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hoursAvailable' => 'The hours during which this service or contact is available.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).', + 'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).', + 'logo' => 'An associated logo.', + '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.', + 'name' => 'The name of the item.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'produces' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + '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.', + 'providerMobility' => 'Indicates the mobility of a provided service (e.g. \'static\', \'dynamic\').', + 'review' => 'A review of the item.', + '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.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'serviceAudience' => 'The audience eligible for this service.', + 'serviceOutput' => 'The tangible thing generated by the service, e.g. a passport, permit, etc.', + 'serviceType' => 'The type of service being offered, e.g. veterans\' benefits, emergency relief, etc.', + 'slogan' => 'A slogan or motto associated with the item.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termsOfService' => 'Human-readable terms of service documentation.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'documentation' => ['CreativeWork', 'URL'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'documentation' => 'Further documentation describing the Web API in more detail.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Further documentation describing the Web API in more detail. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] + * @inheritdoc */ - public $documentation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['documentation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WebAPIInterface.php b/src/models/jsonld/WebAPIInterface.php new file mode 100644 index 000000000..352504a88 --- /dev/null +++ b/src/models/jsonld/WebAPIInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'applicationCategory' => ['Text', 'URL'], + 'applicationSubCategory' => ['URL', 'Text'], + 'applicationSuite' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'availableOnDevice' => ['Text'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'browserRequirements' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countriesNotSupported' => ['Text'], + 'countriesSupported' => ['Text'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'device' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'downloadUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'featureList' => ['Text', 'URL'], + 'fileFormat' => ['URL', 'Text'], + 'fileSize' => ['Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'installUrl' => ['URL'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'memoryRequirements' => ['Text', 'URL'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'operatingSystem' => ['Text'], + 'pattern' => ['DefinedTerm', 'Text'], + 'permissions' => ['Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'processorRequirements' => ['Text'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releaseNotes' => ['URL', 'Text'], + 'releasedEvent' => ['PublicationEvent'], + 'requirements' => ['URL', 'Text'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'screenshot' => ['ImageObject', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'softwareAddOn' => ['SoftwareApplication'], + 'softwareHelp' => ['CreativeWork'], + 'softwareRequirements' => ['URL', 'Text'], + 'softwareVersion' => ['Text'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'storageRequirements' => ['URL', 'Text'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supportingData' => ['DataFeed'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'browserRequirements' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'applicationCategory' => 'Type of software application, e.g. \'Game, Multimedia\'.', + 'applicationSubCategory' => 'Subcategory of the application, e.g. \'Arcade Game\'.', + 'applicationSuite' => 'The name of the application suite to which the application belongs (e.g. Excel belongs to Office).', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'availableOnDevice' => 'Device required to run the application. Used in cases where a specific make/model is required to run the application.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'browserRequirements' => 'Specifies browser requirements in human-readable text. For example, \'requires HTML5 support\'.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countriesNotSupported' => 'Countries for which the application is not supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', + 'countriesSupported' => 'Countries for which the application is supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + 'device' => 'Device required to run the application. Used in cases where a specific make/model is required to run the application.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'downloadUrl' => 'If the file can be downloaded, URL to download the binary.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'featureList' => 'Features or modules provided by this application (and possibly required by other applications).', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'fileSize' => 'Size of the application / package (e.g. 18MB). In the absence of a unit (MB, KB etc.), KB will be assumed.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'installUrl' => 'URL at which the app may be installed, if different from the URL of the item.', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'memoryRequirements' => 'Minimum memory requirements.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'operatingSystem' => 'Operating systems supported (Windows 7, OSX 10.6, Android 1.6).', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'permissions' => 'Permission(s) required to run the app (for example, a mobile app may require full internet access or may run only on wifi).', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'processorRequirements' => 'Processor architecture required to run the application (e.g. IA64).', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releaseNotes' => 'Description of what changed in this version.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'requirements' => 'Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime).', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'screenshot' => 'A link to a screenshot image of the app.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'softwareAddOn' => 'Additional content for a software application.', + 'softwareHelp' => 'Software application help.', + 'softwareRequirements' => 'Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime).', + 'softwareVersion' => 'Version of the software instance.', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'storageRequirements' => 'Storage requirements (free space required).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supportingData' => 'Supporting data for a SoftwareApplication.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'browserRequirements' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'browserRequirements' => 'Specifies browser requirements in human-readable text. For example, \'requires HTML5 support\'.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Specifies browser requirements in human-readable text. For example, - * 'requires HTML5 support'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $browserRequirements; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['browserRequirements'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WebApplicationInterface.php b/src/models/jsonld/WebApplicationInterface.php new file mode 100644 index 000000000..3170dee1d --- /dev/null +++ b/src/models/jsonld/WebApplicationInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'about', - 'abstract', - 'accessMode', - 'accessModeSufficient', - 'accessibilityAPI', - 'accessibilityControl', - 'accessibilityFeature', - 'accessibilityHazard', - 'accessibilitySummary', - 'accountablePerson', - 'acquireLicensePage', - 'aggregateRating', - 'alternativeHeadline', - 'associatedMedia', - 'audience', - 'audio', - 'author', - 'award', - 'character', - 'citation', - 'comment', - 'commentCount', - 'conditionsOfAccess', - 'contentLocation', - 'contentRating', - 'contentReferenceTime', - 'contributor', - 'copyrightHolder', - 'copyrightYear', - 'correction', - 'creativeWorkStatus', - 'creator', - 'dateCreated', - 'dateModified', - 'datePublished', - 'discussionUrl', - 'editor', - 'educationalAlignment', - 'educationalUse', - 'encoding', - 'encodingFormat', - 'exampleOfWork', - 'expires', - 'funder', - 'genre', - 'hasPart', - 'headline', - 'inLanguage', - 'interactionStatistic', - 'interactivityType', - 'isAccessibleForFree', - 'isBasedOn', - 'isFamilyFriendly', - 'isPartOf', - 'keywords', - 'learningResourceType', - 'license', - 'locationCreated', - 'mainEntity', - 'maintainer', - 'material', - 'materialExtent', - 'mentions', - 'offers', - 'position', - 'producer', - 'provider', - 'publication', - 'publisher', - 'publisherImprint', - 'publishingPrinciples', - 'recordedAt', - 'releasedEvent', - 'review', - 'schemaVersion', - 'sdDatePublished', - 'sdLicense', - 'sdPublisher', - 'sourceOrganization', - 'spatial', - 'spatialCoverage', - 'sponsor', - 'temporal', - 'temporalCoverage', - 'text', - 'thumbnailUrl', - 'timeRequired', - 'translationOfWork', - 'translator', - 'typicalAgeRange', - 'usageInfo', - 'version', - 'video', - 'workExample', - 'workTranslation' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'about' => ['Thing'], - 'abstract' => ['Text'], - 'accessMode' => ['Text'], - 'accessModeSufficient' => ['ItemList'], - 'accessibilityAPI' => ['Text'], - 'accessibilityControl' => ['Text'], - 'accessibilityFeature' => ['Text'], - 'accessibilityHazard' => ['Text'], - 'accessibilitySummary' => ['Text'], - 'accountablePerson' => ['Person'], - 'acquireLicensePage' => ['CreativeWork', 'URL'], - 'aggregateRating' => ['AggregateRating'], - 'alternativeHeadline' => ['Text'], - 'associatedMedia' => ['MediaObject'], - 'audience' => ['Audience'], - 'audio' => ['AudioObject', 'Clip', 'MusicRecording'], - 'author' => ['Organization', 'Person'], - 'award' => ['Text'], - 'character' => ['Person'], - 'citation' => ['CreativeWork', 'Text'], - 'comment' => ['Comment'], - 'commentCount' => ['Integer'], - 'conditionsOfAccess' => ['Text'], - 'contentLocation' => ['Place'], - 'contentRating' => ['Rating', 'Text'], - 'contentReferenceTime' => ['DateTime'], - 'contributor' => ['Organization', 'Person'], - 'copyrightHolder' => ['Organization', 'Person'], - 'copyrightYear' => ['Number'], - 'correction' => ['CorrectionComment', 'Text', 'URL'], - 'creativeWorkStatus' => ['DefinedTerm', 'Text'], - 'creator' => ['Organization', 'Person'], - 'dateCreated' => ['Date', 'DateTime'], - 'dateModified' => ['Date', 'DateTime'], - 'datePublished' => ['Date', 'DateTime'], - 'discussionUrl' => ['URL'], - 'editor' => ['Person'], - 'educationalAlignment' => ['AlignmentObject'], - 'educationalUse' => ['Text'], - 'encoding' => ['MediaObject'], - 'encodingFormat' => ['Text', 'URL'], - 'exampleOfWork' => ['CreativeWork'], - 'expires' => ['Date'], - 'funder' => ['Organization', 'Person'], - 'genre' => ['Text', 'URL'], - 'hasPart' => ['CreativeWork'], - 'headline' => ['Text'], - 'inLanguage' => ['Language', 'Text'], - 'interactionStatistic' => ['InteractionCounter'], - 'interactivityType' => ['Text'], - 'isAccessibleForFree' => ['Boolean'], - 'isBasedOn' => ['CreativeWork', 'Product', 'URL'], - 'isFamilyFriendly' => ['Boolean'], - 'isPartOf' => ['CreativeWork', 'URL'], - 'keywords' => ['Text'], - 'learningResourceType' => ['Text'], - 'license' => ['CreativeWork', 'URL'], - 'locationCreated' => ['Place'], - 'mainEntity' => ['Thing'], - 'maintainer' => ['Organization', 'Person'], - 'material' => ['Product', 'Text', 'URL'], - 'materialExtent' => ['QuantitativeValue', 'Text'], - 'mentions' => ['Thing'], - 'offers' => ['Demand', 'Offer'], - 'position' => ['Integer', 'Text'], - 'producer' => ['Organization', 'Person'], - 'provider' => ['Organization', 'Person'], - 'publication' => ['PublicationEvent'], - 'publisher' => ['Organization', 'Person'], - 'publisherImprint' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'recordedAt' => ['Event'], - 'releasedEvent' => ['PublicationEvent'], - 'review' => ['Review'], - 'schemaVersion' => ['Text', 'URL'], - 'sdDatePublished' => ['Date'], - 'sdLicense' => ['CreativeWork', 'URL'], - 'sdPublisher' => ['Organization', 'Person'], - 'sourceOrganization' => ['Organization'], - 'spatial' => ['Place'], - 'spatialCoverage' => ['Place'], - 'sponsor' => ['Organization', 'Person'], - 'temporal' => ['DateTime', 'Text'], - 'temporalCoverage' => ['DateTime', 'Text', 'URL'], - 'text' => ['Text'], - 'thumbnailUrl' => ['URL'], - 'timeRequired' => ['Duration'], - 'translationOfWork' => ['CreativeWork'], - 'translator' => ['Organization', 'Person'], - 'typicalAgeRange' => ['Text'], - 'usageInfo' => ['CreativeWork', 'URL'], - 'version' => ['Number', 'Text'], - 'video' => ['Clip', 'VideoObject'], - 'workExample' => ['CreativeWork'], - 'workTranslation' => ['CreativeWork'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'about' => 'The subject matter of the content. Inverse property: subjectOf.', - 'abstract' => 'An abstract is a short description that summarizes a CreativeWork.', - 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual.', - 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual.', - 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API (WebSchemas wiki lists possible values).', - 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource (WebSchemas wiki lists possible values).', - 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility (WebSchemas wiki lists possible values).', - 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki lists possible values).', - 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', - 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', - 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alternativeHeadline' => 'A secondary title of the CreativeWork.', - 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', - 'audience' => 'An intended audience, i.e. a group for whom something was created. Supersedes serviceAudience.', - 'audio' => 'An embedded audio object.', - 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'character' => 'Fictional person connected with a creative work.', - 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', - 'comment' => 'Comments, typically from users.', - 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', - 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an ArchiveComponent held by an ArchiveOrganization. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".', - 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', - 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', - 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', - 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', - 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', - 'correction' => 'Indicates a correction to a CreativeWork, either via a CorrectionComment, textually or in another document.', - 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', - 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', - 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', - 'datePublished' => 'Date of first broadcast/publication.', - 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', - 'editor' => 'Specifies the Person who edited the CreativeWork.', - 'educationalAlignment' => 'An alignment to an established educational framework.', - 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', - 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. Supersedes encodings. Inverse property: encodesCreativeWork.', - 'encodingFormat' => 'Media type typically expressed using a MIME format (see IANA site and MDN reference) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media type representations, encoding can be used to indicate each MediaObject alongside particular encodingFormat information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes fileFormat.', - 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of. Inverse property: workExample.', - 'expires' => 'Date the content expires and is no longer useful or available. For example a VideoObject or NewsArticle whose availability or relevance is time-limited, or a ClaimReview fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'genre' => 'Genre of the creative work, broadcast channel or group.', - 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). Inverse property: isPartOf.', - 'headline' => 'Headline of the article.', - '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. See also availableLanguage. Supersedes language.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free. Supersedes free.', - 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption. Supersedes isBasedOnUrl.', - 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', - 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. Inverse property: hasPart.', - 'keywords' => 'Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.', - 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', - 'license' => 'A license document that applies to this content, typically indicated by URL.', - 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', - 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork. Inverse property: mainEntityOfPage.', - 'maintainer' => 'A maintainer of a Dataset, software package (SoftwareApplication), or other Project. A maintainer is a Person or Organization that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When maintainer is applied to a specific version of something e.g. a particular version or packaging of a Dataset, it is always possible that the upstream source has a different maintainer. The isBasedOn property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.', - 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', - 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', - 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', - '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. Inverse property: itemOffered.', - 'position' => 'The position of an item in a series or sequence of items.', - 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', - '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. Supersedes carrier.', - 'publication' => 'A publication event associated with the item.', - 'publisher' => 'The publisher of the creative work.', - 'publisherImprint' => 'The publishing division which published the comic.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. Inverse property: recordedIn.', - 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', - 'review' => 'A review of the item. Supersedes reviews.', - 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application.', - 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside sdPublisher', - 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', - 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The sdPublisher property helps make such practices more explicit.', - 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', - 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate.', - 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', - '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.', - 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not known to be appropriate.', - 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in ISO 8601 time interval format. In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. Supersedes datasetTimeInterval.', - 'text' => 'The textual content of this CreativeWork.', - 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', - 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', - 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” Inverse property: workTranslation.', - '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.', - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', - 'usageInfo' => 'The schema.org usageInfo property indicates further information about a CreativeWork. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', - 'version' => 'The version of the CreativeWork embodied by a specified resource.', - 'video' => 'An embedded video object.', - 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. Inverse property: exampleOfWork.', - 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. Inverse property: translationOfWork.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The subject matter of the content. Inverse property: subjectOf. - * - * @var Thing [schema.org types: Thing] - */ - public $about; - /** - * An abstract is a short description that summarizes a CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $abstract; - /** - * The human sensory perceptual system or cognitive faculty through which a - * person may process or perceive information. Expected values include: - * auditory, tactile, textual, visual, colorDependent, chartOnVisual, - * chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. - * - * @var string [schema.org types: Text] - */ - public $accessMode; - /** - * A list of single or combined accessModes that are sufficient to understand - * all the intellectual content of a resource. Expected values include: - * auditory, tactile, textual, visual. - * - * @var ItemList [schema.org types: ItemList] - */ - public $accessModeSufficient; - /** - * Indicates that the resource is compatible with the referenced accessibility - * API (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityAPI; - /** - * Identifies input methods that are sufficient to fully control the described - * resource (WebSchemas wiki lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityControl; - /** - * Content features of the resource, such as accessible media, alternatives - * and supported enhancements for accessibility (WebSchemas wiki lists - * possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityFeature; - /** - * A characteristic of the described resource that is physiologically - * dangerous to some users. Related to WCAG 2.0 guideline 2.3 (WebSchemas wiki - * lists possible values). - * - * @var string [schema.org types: Text] - */ - public $accessibilityHazard; - /** - * A human-readable summary of specific accessibility features or - * deficiencies, consistent with the other accessibility metadata but - * expressing subtleties such as "short descriptions are present but long - * descriptions will be needed for non-visual users" or "short descriptions - * are present and no long descriptions are needed." - * - * @var string [schema.org types: Text] - */ - public $accessibilitySummary; - /** - * Specifies the Person that is legally accountable for the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $accountablePerson; - /** - * Indicates a page documenting how licenses can be purchased or otherwise - * acquired, for the current item. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $acquireLicensePage; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * A secondary title of the CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $alternativeHeadline; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for encoding. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $associatedMedia; - /** - * An intended audience, i.e. a group for whom something was created. - * Supersedes serviceAudience. - * - * @var Audience [schema.org types: Audience] - */ - public $audience; /** - * An embedded audio object. - * - * @var mixed|AudioObject|Clip|MusicRecording [schema.org types: AudioObject, Clip, MusicRecording] - */ - public $audio; - /** - * The author of this content or rating. Please note that author is special in - * that HTML 5 provides a special mechanism for indicating authorship via the - * rel tag. That is equivalent to this and may be used interchangeably. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $author; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * Fictional person connected with a creative work. - * - * @var Person [schema.org types: Person] - */ - public $character; - /** - * A citation or reference to another creative work, such as another - * publication, web page, scholarly article, etc. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, Text] - */ - public $citation; - /** - * Comments, typically from users. - * - * @var Comment [schema.org types: Comment] - */ - public $comment; - /** - * The number of comments this CreativeWork (e.g. Article, Question or Answer) - * has received. This is most applicable to works published in Web sites with - * commenting system; additional comments may exist elsewhere. - * - * @var int [schema.org types: Integer] - */ - public $commentCount; - /** - * Conditions that affect the availability of, or method(s) of access to, an - * item. Typically used for real world items such as an ArchiveComponent held - * by an ArchiveOrganization. This property is not suitable for use as a - * general Web access control mechanism. It is expressed only in natural - * language. For example "Available by appointment from the Reading Room" or - * "Accessible only from logged-in accounts ". - * - * @var string [schema.org types: Text] - */ - public $conditionsOfAccess; - /** - * The location depicted or described in the content. For example, the - * location in a photograph or painting. - * - * @var Place [schema.org types: Place] - */ - public $contentLocation; - /** - * Official rating of a piece of content—for example,'MPAA PG-13'. - * - * @var mixed|Rating|string [schema.org types: Rating, Text] - */ - public $contentRating; - /** - * The specific time described by a creative work, for works (e.g. articles, - * video objects etc.) that emphasise a particular moment within an Event. - * - * @var DateTime [schema.org types: DateTime] - */ - public $contentReferenceTime; - /** - * A secondary contributor to the CreativeWork or Event. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $contributor; - /** - * The party holding the legal copyright to the CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $copyrightHolder; - /** - * The year during which the claimed copyright for the CreativeWork was first - * asserted. - * - * @var float [schema.org types: Number] - */ - public $copyrightYear; - /** - * Indicates a correction to a CreativeWork, either via a CorrectionComment, - * textually or in another document. - * - * @var mixed|CorrectionComment|string|string [schema.org types: CorrectionComment, Text, URL] - */ - public $correction; - /** - * The status of a creative work in terms of its stage in a lifecycle. Example - * terms include Incomplete, Draft, Published, Obsolete. Some organizations - * define a set of terms for the stages of their publication lifecycle. - * - * @var mixed|DefinedTerm|string [schema.org types: DefinedTerm, Text] - */ - public $creativeWorkStatus; - /** - * The creator/author of this CreativeWork. This is the same as the Author - * property for CreativeWork. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $creator; - /** - * The date on which the CreativeWork was created or the item was added to a - * DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateCreated; - /** - * The date on which the CreativeWork was most recently modified or when the - * item's entry was modified within a DataFeed. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $dateModified; - /** - * Date of first broadcast/publication. - * - * @var mixed|Date|DateTime [schema.org types: Date, DateTime] - */ - public $datePublished; - /** - * A link to the page containing the comments of the CreativeWork. - * - * @var string [schema.org types: URL] - */ - public $discussionUrl; - /** - * Specifies the Person who edited the CreativeWork. - * - * @var Person [schema.org types: Person] - */ - public $editor; - /** - * An alignment to an established educational framework. - * - * @var AlignmentObject [schema.org types: AlignmentObject] - */ - public $educationalAlignment; - /** - * The purpose of a work in the context of education; for example, - * 'assignment', 'group work'. - * - * @var string [schema.org types: Text] - */ - public $educationalUse; - /** - * A media object that encodes this CreativeWork. This property is a synonym - * for associatedMedia. Supersedes encodings. Inverse property: - * encodesCreativeWork. - * - * @var MediaObject [schema.org types: MediaObject] - */ - public $encoding; - /** - * Media type typically expressed using a MIME format (see IANA site and MDN - * reference) e.g. application/zip for a SoftwareApplication binary, - * audio/mpeg for .mp3 etc.). In cases where a CreativeWork has several media - * type representations, encoding can be used to indicate each MediaObject - * alongside particular encodingFormat information. Unregistered or niche - * encoding and file formats can be indicated instead via the most appropriate - * URL, e.g. defining Web page or a Wikipedia/Wikidata entry. Supersedes - * fileFormat. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $encodingFormat; - /** - * A creative work that this work is an - * example/instance/realization/derivation of. Inverse property: workExample. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $exampleOfWork; - /** - * Date the content expires and is no longer useful or available. For example - * a VideoObject or NewsArticle whose availability or relevance is - * time-limited, or a ClaimReview fact check whose publisher wants to indicate - * that it may no longer be relevant (or helpful to highlight) after some - * date. - * - * @var Date [schema.org types: Date] - */ - public $expires; - /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * Genre of the creative work, broadcast channel or group. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $genre; - /** - * Indicates an item or CreativeWork that is part of this item, or - * CreativeWork (in some sense). Inverse property: isPartOf. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $hasPart; - /** - * Headline of the article. - * - * @var string [schema.org types: Text] - */ - public $headline; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $inLanguage; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. The number of interactions for the CreativeWork using the - * WebSite or SoftwareApplication. The most specific child type of - * InteractionCounter should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The predominant mode of learning supported by the learning resource. - * Acceptable values are 'active', 'expositive', or 'mixed'. - * - * @var string [schema.org types: Text] - */ - public $interactivityType; - /** - * A flag to signal that the item, event, or place is accessible for free. - * Supersedes free. - * - * @var bool [schema.org types: Boolean] - */ - public $isAccessibleForFree; - /** - * A resource from which this work is derived or from which it is a - * modification or adaption. Supersedes isBasedOnUrl. - * - * @var mixed|CreativeWork|Product|string [schema.org types: CreativeWork, Product, URL] - */ - public $isBasedOn; - /** - * Indicates whether this content is family friendly. - * - * @var bool [schema.org types: Boolean] - */ - public $isFamilyFriendly; - /** - * Indicates an item or CreativeWork that this item, or CreativeWork (in some - * sense), is part of. Inverse property: hasPart. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $isPartOf; - /** - * Keywords or tags used to describe this content. Multiple entries in a - * keywords list are typically delimited by commas. - * - * @var string [schema.org types: Text] - */ - public $keywords; - /** - * The predominant type or kind characterizing the learning resource. For - * example, 'presentation', 'handout'. - * - * @var string [schema.org types: Text] - */ - public $learningResourceType; - /** - * A license document that applies to this content, typically indicated by - * URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $license; - /** - * The location where the CreativeWork was created, which may not be the same - * as the location depicted in the CreativeWork. - * - * @var Place [schema.org types: Place] - */ - public $locationCreated; - /** - * Indicates the primary entity described in some page or other CreativeWork. - * Inverse property: mainEntityOfPage. - * - * @var Thing [schema.org types: Thing] - */ - public $mainEntity; - /** - * A maintainer of a Dataset, software package (SoftwareApplication), or other - * Project. A maintainer is a Person or Organization that manages - * contributions to, and/or publication of, some (typically complex) artifact. - * It is common for distributions of software and data to be based on - * "upstream" sources. When maintainer is applied to a specific version of - * something e.g. a particular version or packaging of a Dataset, it is always - * possible that the upstream source has a different maintainer. The isBasedOn - * property can be used to indicate such relationships between datasets to - * make the different maintenance roles clear. Similarly in the case of - * software, a package may have dedicated maintainers working on integration - * into software distributions such as Ubuntu, as well as upstream maintainers - * of the underlying work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $maintainer; - /** - * A material that something is made from, e.g. leather, wool, cotton, paper. - * - * @var mixed|Product|string|string [schema.org types: Product, Text, URL] - */ - public $material; - /** - * The quantity of the materials being described or an expression of the - * physical space they occupy. - * - * @var mixed|QuantitativeValue|string [schema.org types: QuantitativeValue, Text] - */ - public $materialExtent; - /** - * Indicates that the CreativeWork contains a reference to, but is not - * necessarily about a concept. - * - * @var Thing [schema.org types: Thing] - */ - public $mentions; - /** - * 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. Inverse - * property: itemOffered. - * - * @var mixed|Demand|Offer [schema.org types: Demand, Offer] - */ - public $offers; - /** - * The position of an item in a series or sequence of items. - * - * @var mixed|int|string [schema.org types: Integer, Text] - */ - public $position; - /** - * The person or organization who produced the work (e.g. music album, movie, - * tv/radio series etc.). - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $producer; - /** - * 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. Supersedes - * carrier. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $provider; - /** - * A publication event associated with the item. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $publication; - /** - * The publisher of the creative work. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $publisher; - /** - * The publishing division which published the comic. - * - * @var Organization [schema.org types: Organization] - */ - public $publisherImprint; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * The Event where the CreativeWork was recorded. The CreativeWork may capture - * all or part of the event. Inverse property: recordedIn. - * - * @var Event [schema.org types: Event] - */ - public $recordedAt; - /** - * The place and time the release was issued, expressed as a PublicationEvent. - * - * @var PublicationEvent [schema.org types: PublicationEvent] - */ - public $releasedEvent; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * Indicates (by URL or string) a particular version of a schema used in some - * CreativeWork. For example, a document could declare a schemaVersion using - * an URL such as http://schema.org/version/2.0/ if precise indication of - * schema version was required by some application. - * - * @var mixed|string|string [schema.org types: Text, URL] - */ - public $schemaVersion; - /** - * Indicates the date on which the current structured data was generated / - * published. Typically used alongside sdPublisher - * - * @var Date [schema.org types: Date] - */ - public $sdDatePublished; - /** - * A license document that applies to this structured data, typically - * indicated by URL. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $sdLicense; - /** - * Indicates the party responsible for generating and publishing the current - * structured data markup, typically in cases where the structured data is - * derived automatically from existing published content but published on a - * different site. For example, student projects and open data initiatives - * often re-publish existing content with more explicitly structured metadata. - * The sdPublisher property helps make such practices more explicit. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sdPublisher; - /** - * The Organization on whose behalf the creator was working. - * - * @var Organization [schema.org types: Organization] - */ - public $sourceOrganization; - /** - * The "spatial" property can be used in cases when more specific properties - * (e.g. locationCreated, spatialCoverage, contentLocation) are not known to - * be appropriate. - * - * @var Place [schema.org types: Place] - */ - public $spatial; - /** - * The spatialCoverage of a CreativeWork indicates the place(s) which are the - * focus of the content. It is a subproperty of contentLocation intended - * primarily for more technical and detailed materials. For example with a - * Dataset, it indicates areas that the dataset describes: a dataset of New - * York weather would have spatialCoverage which was the place: the state of - * New York. - * - * @var Place [schema.org types: Place] - */ - public $spatialCoverage; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $sponsor; - /** - * The "temporal" property can be used in cases where more specific properties - * (e.g. temporalCoverage, dateCreated, dateModified, datePublished) are not - * known to be appropriate. - * - * @var mixed|DateTime|string [schema.org types: DateTime, Text] - */ - public $temporal; - /** - * The temporalCoverage of a CreativeWork indicates the period that the - * content applies to, i.e. that it describes, either as a DateTime or as a - * textual string indicating a time period in ISO 8601 time interval format. - * In the case of a Dataset it will typically indicate the relevant time - * period in a precise notation (e.g. for a 2011 census dataset, the year 2011 - * would be written "2011/2012"). Other forms of content e.g. - * ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their - * temporalCoverage in broader terms - textually or via well-known URL. - * Written works such as books may sometimes have precise temporal coverage - * too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval - * format format via "1939/1945". Open-ended date ranges can be written with - * ".." in place of the end date. For example, "2015-11/.." indicates a range - * beginning in November 2015 and with no specified final date. This is - * tentative and might be updated in future when ISO 8601 is officially - * updated. Supersedes datasetTimeInterval. - * - * @var mixed|DateTime|string|string [schema.org types: DateTime, Text, URL] - */ - public $temporalCoverage; - /** - * The textual content of this CreativeWork. - * - * @var string [schema.org types: Text] - */ - public $text; - /** - * A thumbnail image relevant to the Thing. - * - * @var string [schema.org types: URL] - */ - public $thumbnailUrl; - /** - * Approximate or typical time it takes to work with or through this learning - * resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. - * - * @var Duration [schema.org types: Duration] - */ - public $timeRequired; - /** - * The work that this work has been translated from. e.g. 物种起源 is a - * translationOf “On the Origin of Species” Inverse property: - * workTranslation. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $translationOfWork; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $translator; - /** - * The typical expected age range, e.g. '7-9', '11-'. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $typicalAgeRange; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * The schema.org usageInfo property indicates further information about a - * CreativeWork. This property is applicable both to works that are freely - * available and to those that require payment or other transactions. It can - * reference additional information e.g. community expectations on preferred - * linking and citation conventions, as well as purchasing details. For - * something that can be commercially licensed, usageInfo can provide - * detailed, resource-specific information about licensing options. This - * property can be used alongside the license property which indicates - * license(s) applicable to some piece of content. The usageInfo property can - * provide information about other licensing options, e.g. acquiring - * commercial usage rights for an image that is also available under - * non-commercial creative commons licenses. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $usageInfo; - /** - * The version of the CreativeWork embodied by a specified resource. - * - * @var mixed|float|string [schema.org types: Number, Text] - */ - public $version; - /** - * An embedded video object. - * - * @var mixed|Clip|VideoObject [schema.org types: Clip, VideoObject] - */ - public $video; - /** - * Example/instance/realization/derivation of the concept of this creative - * work. eg. The paperback edition, first edition, or eBook. Inverse property: - * exampleOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] - */ - public $workExample; - /** - * A work that is a translation of the content of this work. e.g. 西遊記 - * has an English workTranslation “Journey to the West”,a German - * workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây - * du ký bình khảo. Inverse property: translationOfWork. - * - * @var CreativeWork [schema.org types: CreativeWork] + * @inheritdoc */ - public $workTranslation; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['about', 'abstract', 'accessMode', 'accessModeSufficient', 'accessibilityAPI', 'accessibilityControl', 'accessibilityFeature', 'accessibilityHazard', 'accessibilitySummary', 'accountablePerson', 'acquireLicensePage', 'aggregateRating', 'alternativeHeadline', 'associatedMedia', 'audience', 'audio', 'author', 'award', 'character', 'citation', 'comment', 'commentCount', 'conditionsOfAccess', 'contentLocation', 'contentRating', 'contentReferenceTime', 'contributor', 'copyrightHolder', 'copyrightYear', 'correction', 'creativeWorkStatus', 'creator', 'dateCreated', 'dateModified', 'datePublished', 'discussionUrl', 'editor', 'educationalAlignment', 'educationalUse', 'encoding', 'encodingFormat', 'exampleOfWork', 'expires', 'funder', 'genre', 'hasPart', 'headline', 'inLanguage', 'interactionStatistic', 'interactivityType', 'isAccessibleForFree', 'isBasedOn', 'isFamilyFriendly', 'isPartOf', 'keywords', 'learningResourceType', 'license', 'locationCreated', 'mainEntity', 'maintainer', 'material', 'materialExtent', 'mentions', 'offers', 'position', 'producer', 'provider', 'publication', 'publisher', 'publisherImprint', 'publishingPrinciples', 'recordedAt', 'releasedEvent', 'review', 'schemaVersion', 'sdDatePublished', 'sdLicense', 'sdPublisher', 'sourceOrganization', 'spatial', 'spatialCoverage', 'sponsor', 'temporal', 'temporalCoverage', 'text', 'thumbnailUrl', 'timeRequired', 'translationOfWork', 'translator', 'typicalAgeRange', 'usageInfo', 'version', 'video', 'workExample', 'workTranslation'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WebContentInterface.php b/src/models/jsonld/WebContentInterface.php new file mode 100644 index 000000000..26ed621f5 --- /dev/null +++ b/src/models/jsonld/WebContentInterface.php @@ -0,0 +1,24 @@ +breadcrumb may be used. We recommend explicit declaration if + * these properties are specified, but if they are found outside of an + * itemscope, they will be assumed to be about the page. * * @author nystudio107 * @package Seomatic - * @since 3.0.0 - * @see http://schema.org/WebPage + * @see https://schema.org/WebPage */ -class WebPage extends CreativeWork +class WebPage extends MetaJsonLd implements WebPageInterface, CreativeWorkInterface, ThingInterface { // Static Public Properties // ========================================================================= @@ -35,253 +35,358 @@ class WebPage extends CreativeWork * * @var string */ - static public $schemaTypeName = 'WebPage'; + static public string $schemaTypeName = 'WebPage'; /** * The Schema.org Type Scope * * @var string */ - static public $schemaTypeScope = 'https://schema.org/WebPage'; + static public string $schemaTypeScope = 'https://schema.org/WebPage'; /** - * The Schema.org Type Description + * The Schema.org Type Extends * * @var string */ - static public $schemaTypeDescription = 'A web page. Every web page is implicitly assumed to be declared to be of type WebPage, so the various properties about that webpage, such as breadcrumb may be used. We recommend explicit declaration if these properties are specified, but if they are found outside of an itemscope, they will be assumed to be about the page.'; + static public string $schemaTypeExtends = 'CreativeWork'; /** - * The Schema.org Type Extends + * The Schema.org Type Description * * @var string */ - static public $schemaTypeExtends = 'CreativeWork'; + static public string $schemaTypeDescription = <<breadcrumb may be used. We recommend explicit declaration if these properties are specified, but if they are found outside of an itemscope, they will be assumed to be about the page. +SCHEMADESC; - /** - * The Schema.org composed Property Names - * - * @var array - */ - static public $schemaPropertyNames = []; + use WebPageTrait; + use CreativeWorkTrait; + use ThingTrait; - /** - * The Schema.org composed Property Expected Types - * - * @var array - */ - static public $schemaPropertyExpectedTypes = []; - - /** - * The Schema.org composed Property Descriptions - * - * @var array - */ - static public $schemaPropertyDescriptions = []; + // Public methods + // ========================================================================= /** - * The Schema.org composed Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRequiredSchema = []; + public function getSchemaPropertyNames(): array + { + return array_keys($this->getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'breadcrumb' => ['BreadcrumbList', 'Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'lastReviewed' => ['Date'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainContentOfPage' => ['WebPageElement'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'primaryImageOfPage' => ['ImageObject'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'relatedLink' => ['URL'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviewedBy' => ['Organization', 'Person'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'significantLink' => ['URL'], + 'significantLinks' => ['URL'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'speakable' => ['URL', 'SpeakableSpecification'], + 'specialty' => ['Specialty'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'breadcrumb', - 'lastReviewed', - 'mainContentOfPage', - 'primaryImageOfPage', - 'relatedLink', - 'reviewedBy', - 'significantLink', - 'speakable', - 'specialty' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'breadcrumb' => ['BreadcrumbList', 'Text'], - 'lastReviewed' => ['Date'], - 'mainContentOfPage' => ['WebPageElement'], - 'primaryImageOfPage' => ['ImageObject'], - 'relatedLink' => ['URL'], - 'reviewedBy' => ['Organization', 'Person'], - 'significantLink' => ['URL'], - 'speakable' => ['SpeakableSpecification', 'URL'], - 'specialty' => ['Specialty'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', - 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', - 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page. Supersedes aspect.', - 'primaryImageOfPage' => 'Indicates the main image on the page.', - 'relatedLink' => 'A link related to this web page, for example to other related web pages.', - 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', - 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. Supersedes significantLinks.', - 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The speakable property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) id-value URL references - uses id-value of an element in the page being annotated. The simplest use of speakable has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the cssSelector property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the xpath property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, SpeakableSpecification which is defined to be a possible value of the speakable property.', - 'specialty' => 'One of the domain specialities to which this web page\'s content applies.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A set of links that can help a user understand and navigate a website - * hierarchy. - * - * @var mixed|BreadcrumbList|string [schema.org types: BreadcrumbList, Text] - */ - public $breadcrumb; - /** - * Date on which the content on this web page was last reviewed for accuracy - * and/or completeness. - * - * @var Date [schema.org types: Date] - */ - public $lastReviewed; - /** - * Indicates if this web page element is the main subject of the page. - * Supersedes aspect. - * - * @var WebPageElement [schema.org types: WebPageElement] - */ - public $mainContentOfPage; - /** - * Indicates the main image on the page. - * - * @var ImageObject [schema.org types: ImageObject] + * @inheritdoc */ - public $primaryImageOfPage; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'breadcrumb' => 'A set of links that can help a user understand and navigate a website hierarchy.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'lastReviewed' => 'Date on which the content on this web page was last reviewed for accuracy and/or completeness.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainContentOfPage' => 'Indicates if this web page element is the main subject of the page.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'primaryImageOfPage' => 'Indicates the main image on the page.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'relatedLink' => 'A link related to this web page, for example to other related web pages.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviewedBy' => 'People or organizations that have reviewed the content on this web page for accuracy and/or completeness.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'significantLink' => 'One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'significantLinks' => 'The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + 'speakable' => 'Indicates sections of a Web page that are particularly \'speakable\' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the \'speakable\' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible \'content-locator\' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. ', + 'specialty' => 'One of the domain specialities to which this web page\'s content applies.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= /** - * A link related to this web page, for example to other related web pages. - * - * @var string [schema.org types: URL] - */ - public $relatedLink; - /** - * People or organizations that have reviewed the content on this web page for - * accuracy and/or completeness. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $reviewedBy; - /** - * One of the more significant URLs on the page. Typically, these are the - * non-navigation links that are clicked on the most. Supersedes - * significantLinks. - * - * @var string [schema.org types: URL] - */ - public $significantLink; - /** - * Indicates sections of a Web page that are particularly 'speakable' in the - * sense of being highlighted as being especially appropriate for - * text-to-speech conversion. Other sections of a page may also be usefully - * spoken in particular circumstances; the 'speakable' property serves to - * indicate the parts most likely to be generally useful for speech. The - * speakable property can be repeated an arbitrary number of times, with three - * kinds of possible 'content-locator' values: 1.) id-value URL references - - * uses id-value of an element in the page being annotated. The simplest use - * of speakable has (potentially relative) URL values, referencing identified - * sections of the document concerned. 2.) CSS Selectors - addresses content - * in the annotated page, eg. via class attribute. Use the cssSelector - * property. 3.) XPaths - addresses content via XPaths (assuming an XML view - * of the content). Use the xpath property. For more sophisticated markup of - * speakable sections beyond simple ID references, either CSS selectors or - * XPath expressions to pick out document section(s) as speakable. For this we - * define a supporting type, SpeakableSpecification which is defined to be a - * possible value of the speakable property. - * - * @var mixed|SpeakableSpecification|string [schema.org types: SpeakableSpecification, URL] - */ - public $speakable; - /** - * One of the domain specialities to which this web page's content applies. - * - * @var Specialty [schema.org types: Specialty] + * @inheritdoc */ - public $specialty; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['breadcrumb', 'lastReviewed', 'mainContentOfPage', 'primaryImageOfPage', 'relatedLink', 'reviewedBy', 'significantLink', 'speakable', 'specialty'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WebPageElement.php b/src/models/jsonld/WebPageElement.php index cefbaf68a..49d503a69 100644 --- a/src/models/jsonld/WebPageElement.php +++ b/src/models/jsonld/WebPageElement.php @@ -1,27 +1,27 @@ getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'cssSelector' => ['CssSelectorType'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'], + 'xpath' => ['XPathType'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'cssSelector', - 'xpath' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'cssSelector' => ['CssSelectorType'], - 'xpath' => ['XPathType'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'cssSelector' => 'A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.', + 'xpath' => 'An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'cssSelector' => 'A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".', - 'xpath' => 'An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A CSS selector, e.g. of a SpeakableSpecification or WebPageElement. In the - * latter case, multiple matches within a page can constitute a single - * conceptual "Web page element". - * - * @var CssSelectorType [schema.org types: CssSelectorType] - */ - public $cssSelector; - /** - * An XPath, e.g. of a SpeakableSpecification or WebPageElement. In the latter - * case, multiple matches within a page can constitute a single conceptual - * "Web page element". - * - * @var XPathType [schema.org types: XPathType] + * @inheritdoc */ - public $xpath; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['cssSelector', 'xpath'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WebPageElementInterface.php b/src/models/jsonld/WebPageElementInterface.php new file mode 100644 index 000000000..fb0519c46 --- /dev/null +++ b/src/models/jsonld/WebPageElementInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'about' => ['Thing'], + 'abstract' => ['Text'], + 'accessMode' => ['Text'], + 'accessModeSufficient' => ['ItemList'], + 'accessibilityAPI' => ['Text'], + 'accessibilityControl' => ['Text'], + 'accessibilityFeature' => ['Text'], + 'accessibilityHazard' => ['Text'], + 'accessibilitySummary' => ['Text'], + 'accountablePerson' => ['Person'], + 'acquireLicensePage' => ['CreativeWork', 'URL'], + 'additionalType' => ['URL'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alternativeHeadline' => ['Text'], + 'archivedAt' => ['WebPage', 'URL'], + 'assesses' => ['Text', 'DefinedTerm'], + 'associatedMedia' => ['MediaObject'], + 'audience' => ['Audience'], + 'audio' => ['AudioObject', 'MusicRecording', 'Clip'], + 'author' => ['Person', 'Organization'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'character' => ['Person'], + 'citation' => ['CreativeWork', 'Text'], + 'comment' => ['Comment'], + 'commentCount' => ['Integer'], + 'conditionsOfAccess' => ['Text'], + 'contentLocation' => ['Place'], + 'contentRating' => ['Text', 'Rating'], + 'contentReferenceTime' => ['DateTime'], + 'contributor' => ['Organization', 'Person'], + 'copyrightHolder' => ['Organization', 'Person'], + 'copyrightNotice' => ['Text'], + 'copyrightYear' => ['Number'], + 'correction' => ['URL', 'Text', 'CorrectionComment'], + 'countryOfOrigin' => ['Country'], + 'creativeWorkStatus' => ['Text', 'DefinedTerm'], + 'creator' => ['Organization', 'Person'], + 'creditText' => ['Text'], + 'dateCreated' => ['Date', 'DateTime'], + 'dateModified' => ['DateTime', 'Date'], + 'datePublished' => ['Date', 'DateTime'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'discussionUrl' => ['URL'], + 'editEIDR' => ['URL', 'Text'], + 'editor' => ['Person'], + 'educationalAlignment' => ['AlignmentObject'], + 'educationalLevel' => ['URL', 'DefinedTerm', 'Text'], + 'educationalUse' => ['DefinedTerm', 'Text'], + 'encoding' => ['MediaObject'], + 'encodingFormat' => ['Text', 'URL'], + 'encodings' => ['MediaObject'], + 'exampleOfWork' => ['CreativeWork'], + 'expires' => ['Date'], + 'fileFormat' => ['URL', 'Text'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'genre' => ['URL', 'Text'], + 'hasPart' => ['CreativeWork'], + 'headline' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'interactionStatistic' => ['InteractionCounter'], + 'interactivityType' => ['Text'], + 'interpretedAsClaim' => ['Claim'], + 'isAccessibleForFree' => ['Boolean'], + 'isBasedOn' => ['CreativeWork', 'URL', 'Product'], + 'isBasedOnUrl' => ['URL', 'CreativeWork', 'Product'], + 'isFamilyFriendly' => ['Boolean'], + 'isPartOf' => ['URL', 'CreativeWork'], + 'issn' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'learningResourceType' => ['DefinedTerm', 'Text'], + 'license' => ['URL', 'CreativeWork'], + 'locationCreated' => ['Place'], + 'mainEntity' => ['Thing'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maintainer' => ['Person', 'Organization'], + 'material' => ['Text', 'URL', 'Product'], + 'materialExtent' => ['QuantitativeValue', 'Text'], + 'mentions' => ['Thing'], + 'name' => ['Text'], + 'offers' => ['Offer', 'Demand'], + 'pattern' => ['DefinedTerm', 'Text'], + 'position' => ['Integer', 'Text'], + 'potentialAction' => ['Action'], + 'producer' => ['Organization', 'Person'], + 'provider' => ['Organization', 'Person'], + 'publication' => ['PublicationEvent'], + 'publisher' => ['Person', 'Organization'], + 'publisherImprint' => ['Organization'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'recordedAt' => ['Event'], + 'releasedEvent' => ['PublicationEvent'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'schemaVersion' => ['Text', 'URL'], + 'sdDatePublished' => ['Date'], + 'sdLicense' => ['CreativeWork', 'URL'], + 'sdPublisher' => ['Organization', 'Person'], + 'size' => ['QuantitativeValue', 'DefinedTerm', 'Text', 'SizeSpecification'], + 'sourceOrganization' => ['Organization'], + 'spatial' => ['Place'], + 'spatialCoverage' => ['Place'], + 'sponsor' => ['Organization', 'Person'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'teaches' => ['DefinedTerm', 'Text'], + 'temporal' => ['DateTime', 'Text'], + 'temporalCoverage' => ['URL', 'DateTime', 'Text'], + 'text' => ['Text'], + 'thumbnailUrl' => ['URL'], + 'timeRequired' => ['Duration'], + 'translationOfWork' => ['CreativeWork'], + 'translator' => ['Person', 'Organization'], + 'typicalAgeRange' => ['Text'], + 'url' => ['URL'], + 'usageInfo' => ['CreativeWork', 'URL'], + 'version' => ['Number', 'Text'], + 'video' => ['Clip', 'VideoObject'], + 'workExample' => ['CreativeWork'], + 'workTranslation' => ['CreativeWork'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'issn' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'about' => 'The subject matter of the content.', + 'abstract' => 'An abstract is a short description that summarizes a [[CreativeWork]].', + 'accessMode' => 'The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).', + 'accessModeSufficient' => 'A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).', + 'accessibilityAPI' => 'Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).', + 'accessibilityControl' => 'Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).', + 'accessibilityFeature' => 'Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).', + 'accessibilityHazard' => 'A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).', + 'accessibilitySummary' => 'A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."', + 'accountablePerson' => 'Specifies the Person that is legally accountable for the CreativeWork.', + 'acquireLicensePage' => 'Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.', + '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.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alternativeHeadline' => 'A secondary title of the CreativeWork.', + 'archivedAt' => 'Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.', + 'assesses' => 'The item being described is intended to assess the competency or learning outcome defined by the referenced term.', + 'associatedMedia' => 'A media object that encodes this CreativeWork. This property is a synonym for encoding.', + 'audience' => 'An intended audience, i.e. a group for whom something was created.', + 'audio' => 'An embedded audio object.', + 'author' => 'The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'character' => 'Fictional person connected with a creative work.', + 'citation' => 'A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.', + 'comment' => 'Comments, typically from users.', + 'commentCount' => 'The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.', + 'conditionsOfAccess' => 'Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language. For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". ', + 'contentLocation' => 'The location depicted or described in the content. For example, the location in a photograph or painting.', + 'contentRating' => 'Official rating of a piece of content—for example,\'MPAA PG-13\'.', + 'contentReferenceTime' => 'The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.', + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', + 'copyrightHolder' => 'The party holding the legal copyright to the CreativeWork.', + 'copyrightNotice' => 'Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.', + 'copyrightYear' => 'The year during which the claimed copyright for the CreativeWork was first asserted.', + 'correction' => 'Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.', + 'countryOfOrigin' => 'The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.', + 'creativeWorkStatus' => 'The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.', + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', + 'creditText' => 'Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.', + 'dateCreated' => 'The date on which the CreativeWork was created or the item was added to a DataFeed.', + 'dateModified' => 'The date on which the CreativeWork was most recently modified or when the item\'s entry was modified within a DataFeed.', + 'datePublished' => 'Date of first broadcast/publication.', + 'description' => 'A description of the item.', + '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.', + 'discussionUrl' => 'A link to the page containing the comments of the CreativeWork.', + 'editEIDR' => 'An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. ', + 'editor' => 'Specifies the Person who edited the CreativeWork.', + 'educationalAlignment' => 'An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.', + 'educationalLevel' => 'The level in terms of progression through an educational or training context. Examples of educational levels include \'beginner\', \'intermediate\' or \'advanced\', and formal sets of level indicators.', + 'educationalUse' => 'The purpose of a work in the context of education; for example, \'assignment\', \'group work\'.', + 'encoding' => 'A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.', + 'encodingFormat' => 'Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.', + 'encodings' => 'A media object that encodes this CreativeWork.', + 'exampleOfWork' => 'A creative work that this work is an example/instance/realization/derivation of.', + 'expires' => 'Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.', + 'fileFormat' => 'Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, \'encoding\' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'genre' => 'Genre of the creative work, broadcast channel or group.', + 'hasPart' => 'Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).', + 'headline' => 'Headline of the article.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'interactivityType' => 'The predominant mode of learning supported by the learning resource. Acceptable values are \'active\', \'expositive\', or \'mixed\'.', + 'interpretedAsClaim' => 'Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isBasedOn' => 'A resource from which this work is derived or from which it is a modification or adaption.', + 'isBasedOnUrl' => 'A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.', + 'isFamilyFriendly' => 'Indicates whether this content is family friendly.', + 'isPartOf' => 'Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.', + 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.', + '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.', + 'learningResourceType' => 'The predominant type or kind characterizing the learning resource. For example, \'presentation\', \'handout\'.', + 'license' => 'A license document that applies to this content, typically indicated by URL.', + 'locationCreated' => 'The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.', + 'mainEntity' => 'Indicates the primary entity described in some page or other CreativeWork.', + '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.', + 'maintainer' => 'A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. ', + 'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.', + 'materialExtent' => 'The quantity of the materials being described or an expression of the physical space they occupy.', + 'mentions' => 'Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.', + 'name' => 'The name of the item.', + '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. ', + 'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.', + 'position' => 'The position of an item in a series or sequence of items.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'producer' => 'The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.).', + '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.', + 'publication' => 'A publication event associated with the item.', + 'publisher' => 'The publisher of the creative work.', + 'publisherImprint' => 'The publishing division which published the comic.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'recordedAt' => 'The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.', + 'releasedEvent' => 'The place and time the release was issued, expressed as a PublicationEvent.', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'schemaVersion' => 'Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.', + 'sdDatePublished' => 'Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]', + 'sdLicense' => 'A license document that applies to this structured data, typically indicated by URL.', + 'sdPublisher' => 'Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit.', + 'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ', + 'sourceOrganization' => 'The Organization on whose behalf the creator was working.', + 'spatial' => 'The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.', + 'spatialCoverage' => 'The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'teaches' => 'The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.', + 'temporal' => 'The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.', + 'temporalCoverage' => 'The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.', + 'text' => 'The textual content of this CreativeWork.', + 'thumbnailUrl' => 'A thumbnail image relevant to the Thing.', + 'timeRequired' => 'Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. \'PT30M\', \'PT1H25M\'.', + 'translationOfWork' => 'The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species”', + '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.', + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', + 'url' => 'URL of the item.', + 'usageInfo' => 'The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.', + 'version' => 'The version of the CreativeWork embodied by a specified resource.', + 'video' => 'An embedded video object.', + 'workExample' => 'Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook.', + 'workTranslation' => 'A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'issn' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'issn' => 'The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The International Standard Serial Number (ISSN) that identifies this serial - * publication. You can repeat this property to identify different formats of, - * or the linking ISSN (ISSN-L) for, this serial publication. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $issn; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['issn'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WebSiteInterface.php b/src/models/jsonld/WebSiteInterface.php new file mode 100644 index 000000000..6fe85aa21 --- /dev/null +++ b/src/models/jsonld/WebSiteInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WednesdayInterface.php b/src/models/jsonld/WednesdayInterface.php new file mode 100644 index 000000000..fc6942410 --- /dev/null +++ b/src/models/jsonld/WednesdayInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WesternConventionalInterface.php b/src/models/jsonld/WesternConventionalInterface.php new file mode 100644 index 000000000..47706ff14 --- /dev/null +++ b/src/models/jsonld/WesternConventionalInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WholesaleInterface.php b/src/models/jsonld/WholesaleInterface.php new file mode 100644 index 000000000..36158171e --- /dev/null +++ b/src/models/jsonld/WholesaleInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'currenciesAccepted', - 'openingHours', - 'paymentAccepted', - 'priceRange' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'currenciesAccepted' => ['Text'], - 'openingHours' => ['Text'], - 'paymentAccepted' => ['Text'], - 'priceRange' => ['Text'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'currenciesAccepted' => 'The currency accepted. Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".', - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .', - 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', - 'priceRange' => 'The price range of the business, for example $$$.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The currency accepted. Use standard formats: ISO 4217 currency format e.g. - * "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for - * Local Exchange Tradings Systems (LETS) and other currency types e.g. - * "Ithaca HOUR". - * - * @var string [schema.org types: Text] - */ - public $currenciesAccepted; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] - */ - public $openingHours; - /** - * Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. - * - * @var string [schema.org types: Text] - */ - public $paymentAccepted; /** - * The price range of the business, for example $$$. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $priceRange; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['currenciesAccepted', 'openingHours', 'paymentAccepted', 'priceRange'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WholesaleStoreInterface.php b/src/models/jsonld/WholesaleStoreInterface.php new file mode 100644 index 000000000..de5a7332a --- /dev/null +++ b/src/models/jsonld/WholesaleStoreInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'instrument' => ['Thing'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'loser' => ['Person'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'loser' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'loser' => 'A sub property of participant. The loser of the action.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'loser' => ['Person'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'loser' => 'A sub property of participant. The loser of the action.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A sub property of participant. The loser of the action. - * - * @var Person [schema.org types: Person] + * @inheritdoc */ - public $loser; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['loser'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WinActionInterface.php b/src/models/jsonld/WinActionInterface.php new file mode 100644 index 000000000..9042b407f --- /dev/null +++ b/src/models/jsonld/WinActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'acceptsReservations' => ['Text', 'Boolean', 'URL'], + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'branchCode' => ['Text'], + 'branchOf' => ['Organization'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'currenciesAccepted' => ['Text'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'hasMenu' => ['URL', 'Text', 'Menu'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'latitude' => ['Text', 'Number'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'menu' => ['URL', 'Menu', 'Text'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'paymentAccepted' => ['Text'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'priceRange' => ['Text'], + 'publicAccess' => ['Boolean'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'servesCuisine' => ['Text'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'sponsor' => ['Organization', 'Person'], + 'starRating' => ['Rating'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'acceptsReservations', - 'hasMenu', - 'servesCuisine', - 'starRating' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'acceptsReservations' => ['Boolean', 'Text', 'URL'], - 'hasMenu' => ['Menu', 'Text', 'URL'], - 'servesCuisine' => ['Text'], - 'starRating' => ['Rating'] - ]; /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings Yes or No.', - 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu. Supersedes menu.', - 'servesCuisine' => 'The cuisine of the restaurant.', - 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'acceptsReservations' => 'Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.', + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'branchOf' => 'The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]].', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'currenciesAccepted' => 'The currency accepted. 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 Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR".', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + 'hasMenu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'menu' => 'Either the actual menu as a structured representation, as text, or a URL of the menu.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'paymentAccepted' => 'Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'priceRange' => 'The price range of the business, for example ```$$$```.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'servesCuisine' => 'The cuisine of the restaurant.', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + '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.', + 'starRating' => 'An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Indicates whether a FoodEstablishment accepts reservations. Values can be - * Boolean, an URL at which reservations can be made or (for backwards - * compatibility) the strings Yes or No. - * - * @var mixed|bool|string|string [schema.org types: Boolean, Text, URL] - */ - public $acceptsReservations; - /** - * Either the actual menu as a structured representation, as text, or a URL of - * the menu. Supersedes menu. - * - * @var mixed|Menu|string|string [schema.org types: Menu, Text, URL] - */ - public $hasMenu; - /** - * The cuisine of the restaurant. - * - * @var string [schema.org types: Text] - */ - public $servesCuisine; /** - * An official rating for a lodging business or food establishment, e.g. from - * national associations or standards bodies. Use the author property to - * indicate the rating organization, e.g. as an Organization with name such as - * (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). - * - * @var Rating [schema.org types: Rating] + * @inheritdoc */ - public $starRating; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['acceptsReservations', 'hasMenu', 'servesCuisine', 'starRating'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WineryInterface.php b/src/models/jsonld/WineryInterface.php new file mode 100644 index 000000000..d76f27725 --- /dev/null +++ b/src/models/jsonld/WineryInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WithdrawnInterface.php b/src/models/jsonld/WithdrawnInterface.php new file mode 100644 index 000000000..66042bad9 --- /dev/null +++ b/src/models/jsonld/WithdrawnInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'applicationDeadline' => ['Date'], + 'applicationStartDate' => ['Date'], + 'dayOfWeek' => ['DayOfWeek'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'educationalCredentialAwarded' => ['URL', 'EducationalOccupationalCredential', 'Text'], + 'educationalProgramMode' => ['URL', 'Text'], + 'endDate' => ['Date', 'DateTime'], + 'financialAidEligible' => ['Text', 'DefinedTerm'], + 'hasCourse' => ['Course'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'maximumEnrollment' => ['Integer'], + 'name' => ['Text'], + 'numberOfCredits' => ['Integer', 'StructuredValue'], + 'occupationalCategory' => ['CategoryCode', 'Text'], + 'occupationalCredentialAwarded' => ['EducationalOccupationalCredential', 'Text', 'URL'], + 'offers' => ['Offer', 'Demand'], + 'potentialAction' => ['Action'], + 'programPrerequisites' => ['AlignmentObject', 'Course', 'EducationalOccupationalCredential', 'Text'], + 'programType' => ['Text', 'DefinedTerm'], + 'provider' => ['Organization', 'Person'], + 'salaryUponCompletion' => ['MonetaryAmountDistribution'], + 'sameAs' => ['URL'], + 'startDate' => ['DateTime', 'Date'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'termDuration' => ['Duration'], + 'termsPerYear' => ['Number'], + 'timeOfDay' => ['Text'], + 'timeToComplete' => ['Duration'], + 'trainingSalary' => ['MonetaryAmountDistribution'], + 'typicalCreditsPerTerm' => ['Integer', 'StructuredValue'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'occupationalCategory', - 'trainingSalary' - ]; /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ - 'occupationalCategory' => ['CategoryCode', 'Text'], - 'trainingSalary' => ['MonetaryAmountDistribution'] - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'applicationDeadline' => 'The date at which the program stops collecting applications for the next enrollment cycle.', + 'applicationStartDate' => 'The date at which the program begins collecting applications for the next enrollment cycle.', + 'dayOfWeek' => 'The day of the week for which these opening hours are valid.', + 'description' => 'A description of the item.', + '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.', + 'educationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other educational credential awarded as a consequence of successful completion of this course or program.', + 'educationalProgramMode' => 'Similar to courseMode, The medium or means of delivery of the program as a whole. The value may either be a text label (e.g. "online", "onsite" or "blended"; "synchronous" or "asynchronous"; "full-time" or "part-time") or a URL reference to a term from a controlled vocabulary (e.g. https://ceds.ed.gov/element/001311#Asynchronous ).', + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'financialAidEligible' => 'A financial aid type or program which students may use to pay for tuition or fees associated with the program.', + 'hasCourse' => 'A course or class that is one of the learning opportunities that constitute an educational / occupational program. No information is implied about whether the course is mandatory or optional; no guarantee is implied about whether the course will be available to everyone on the program.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'maximumEnrollment' => 'The maximum number of students who may be enrolled in the program.', + 'name' => 'The name of the item.', + 'numberOfCredits' => 'The number of credits or units awarded by a Course or required to complete an EducationalOccupationalProgram.', + 'occupationalCategory' => 'A category describing the job, preferably using a term from a taxonomy such as [BLS O*NET-SOC](http://www.onetcenter.org/taxonomy.html), [ISCO-08](https://www.ilo.org/public/english/bureau/stat/isco/isco08/) or similar, with the property repeated for each applicable value. Ideally the taxonomy should be identified, and both the textual label and formal code for the category should be provided. Note: for historical reasons, any textual label and formal code provided as a literal may be assumed to be from O*NET-SOC.', + 'occupationalCredentialAwarded' => 'A description of the qualification, award, certificate, diploma or other occupational credential awarded as a consequence of successful completion of this course or program.', + '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. ', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'programPrerequisites' => 'Prerequisites for enrolling in the program.', + 'programType' => 'The type of educational or occupational program. For example, classroom, internship, alternance, etc..', + '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.', + 'salaryUponCompletion' => 'The expected salary upon completing the training.', + '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.', + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'termDuration' => 'The amount of time in a term as defined by the institution. A term is a length of time where students take one or more classes. Semesters and quarters are common units for term.', + 'termsPerYear' => 'The number of times terms of study are offered per year. Semesters and quarters are common units for term. For example, if the student can only take 2 semesters for the program in one year, then termsPerYear should be 2.', + 'timeOfDay' => 'The time of day the program normally runs. For example, "evenings".', + 'timeToComplete' => 'The expected length of time to complete the program if attending full-time.', + 'trainingSalary' => 'The estimated salary earned while in the program.', + 'typicalCreditsPerTerm' => 'The number of credits or units a full-time student would be expected to take in 1 term however \'term\' is defined by the institution.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'occupationalCategory' => 'A category describing the job, preferably using a term from a taxonomy such as BLS O*NET-SOC, ISCO-08 or similar, with the property repeated for each applicable value. Ideally the taxonomy should be identified, and both the textual label and formal code for the category should be provided. Note: for historical reasons, any textual label and formal code provided as a literal may be assumed to be from O*NET-SOC.', - 'trainingSalary' => 'The estimated salary earned while in the program.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * A category describing the job, preferably using a term from a taxonomy such - * as BLS O*NET-SOC, ISCO-08 or similar, with the property repeated for each - * applicable value. Ideally the taxonomy should be identified, and both the - * textual label and formal code for the category should be provided. Note: - * for historical reasons, any textual label and formal code provided as a - * literal may be assumed to be from O*NET-SOC. - * - * @var mixed|CategoryCode|string [schema.org types: CategoryCode, Text] - */ - public $occupationalCategory; - /** - * The estimated salary earned while in the program. - * - * @var MonetaryAmountDistribution [schema.org types: MonetaryAmountDistribution] + * @inheritdoc */ - public $trainingSalary; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['occupationalCategory', 'trainingSalary'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WorkBasedProgramInterface.php b/src/models/jsonld/WorkBasedProgramInterface.php new file mode 100644 index 000000000..fb0ae9c06 --- /dev/null +++ b/src/models/jsonld/WorkBasedProgramInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionableFeedbackPolicy' => ['URL', 'CreativeWork'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'alumni' => ['Person'], + 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Text', 'Place'], + 'award' => ['Text'], + 'awards' => ['Text'], + 'brand' => ['Organization', 'Brand'], + 'contactPoint' => ['ContactPoint'], + 'contactPoints' => ['ContactPoint'], + 'correctionsPolicy' => ['URL', 'CreativeWork'], + 'department' => ['Organization'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'dissolutionDate' => ['Date'], + 'diversityPolicy' => ['CreativeWork', 'URL'], + 'diversityStaffingReport' => ['URL', 'Article'], + 'duns' => ['Text'], + 'email' => ['Text'], + 'employee' => ['Person'], + 'employees' => ['Person'], + 'ethicsPolicy' => ['URL', 'CreativeWork'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'founder' => ['Person'], + 'founders' => ['Person'], + 'foundingDate' => ['Date'], + 'foundingLocation' => ['Place'], + 'funder' => ['Organization', 'Person'], + 'funding' => ['Grant'], + 'globalLocationNumber' => ['Text'], + 'hasCredential' => ['EducationalOccupationalCredential'], + 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], + 'hasOfferCatalog' => ['OfferCatalog'], + 'hasPOS' => ['Place'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'interactionStatistic' => ['InteractionCounter'], + 'isicV4' => ['Text'], + 'iso6523Code' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'knowsAbout' => ['URL', 'Text', 'Thing'], + 'knowsLanguage' => ['Language', 'Text'], + 'legalName' => ['Text'], + 'leiCode' => ['Text'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'logo' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'makesOffer' => ['Offer'], + 'member' => ['Organization', 'Person'], + 'memberOf' => ['ProgramMembership', 'Organization'], + 'members' => ['Person', 'Organization'], + 'naics' => ['Text'], + 'name' => ['Text'], + 'nonprofitStatus' => ['NonprofitType'], + 'numberOfEmployees' => ['QuantitativeValue'], + 'ownershipFundingInfo' => ['URL', 'AboutPage', 'Text', 'CreativeWork'], + 'owns' => ['Product', 'OwnershipInfo'], + 'parentOrganization' => ['Organization'], + 'potentialAction' => ['Action'], + 'publishingPrinciples' => ['URL', 'CreativeWork'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'seeks' => ['Demand'], + 'serviceArea' => ['GeoShape', 'AdministrativeArea', 'Place'], + 'slogan' => ['Text'], + 'sponsor' => ['Organization', 'Person'], + 'subOrganization' => ['Organization'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'taxID' => ['Text'], + 'telephone' => ['Text'], + 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], + 'url' => ['URL'], + 'vatID' => ['Text'] + ]; + } - // Public Properties - // ========================================================================= - /** - * The Schema.org Property Names - * - * @var array - */ - static protected $_schemaPropertyNames = [ - 'actionableFeedbackPolicy', - 'address', - 'aggregateRating', - 'alumni', - 'areaServed', - 'award', - 'brand', - 'contactPoint', - 'correctionsPolicy', - 'department', - 'dissolutionDate', - 'diversityPolicy', - 'diversityStaffingReport', - 'duns', - 'email', - 'employee', - 'ethicsPolicy', - 'event', - 'faxNumber', - 'founder', - 'foundingDate', - 'foundingLocation', - 'funder', - 'globalLocationNumber', - 'hasCredential', - 'hasMerchantReturnPolicy', - 'hasOfferCatalog', - 'hasPOS', - 'interactionStatistic', - 'isicV4', - 'knowsAbout', - 'knowsLanguage', - 'legalName', - 'leiCode', - 'location', - 'logo', - 'makesOffer', - 'member', - 'memberOf', - 'naics', - 'numberOfEmployees', - 'ownershipFundingInfo', - 'owns', - 'parentOrganization', - 'publishingPrinciples', - 'review', - 'seeks', - 'slogan', - 'sponsor', - 'subOrganization', - 'taxID', - 'telephone', - 'unnamedSourcesPolicy', - 'vatID' - ]; - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'actionableFeedbackPolicy' => ['CreativeWork', 'URL'], - 'address' => ['PostalAddress', 'Text'], - 'aggregateRating' => ['AggregateRating'], - 'alumni' => ['Person'], - 'areaServed' => ['AdministrativeArea', 'GeoShape', 'Place', 'Text'], - 'award' => ['Text'], - 'brand' => ['Brand', 'Organization'], - 'contactPoint' => ['ContactPoint'], - 'correctionsPolicy' => ['CreativeWork', 'URL'], - 'department' => ['Organization'], - 'dissolutionDate' => ['Date'], - 'diversityPolicy' => ['CreativeWork', 'URL'], - 'diversityStaffingReport' => ['Article', 'URL'], - 'duns' => ['Text'], - 'email' => ['Text'], - 'employee' => ['Person'], - 'ethicsPolicy' => ['CreativeWork', 'URL'], - 'event' => ['Event'], - 'faxNumber' => ['Text'], - 'founder' => ['Person'], - 'foundingDate' => ['Date'], - 'foundingLocation' => ['Place'], - 'funder' => ['Organization', 'Person'], - 'globalLocationNumber' => ['Text'], - 'hasCredential' => ['EducationalOccupationalCredential'], - 'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'], - 'hasOfferCatalog' => ['OfferCatalog'], - 'hasPOS' => ['Place'], - 'interactionStatistic' => ['InteractionCounter'], - 'isicV4' => ['Text'], - 'knowsAbout' => ['Text', 'Thing', 'URL'], - 'knowsLanguage' => ['Language', 'Text'], - 'legalName' => ['Text'], - 'leiCode' => ['Text'], - 'location' => ['Place', 'PostalAddress', 'Text', 'VirtualLocation'], - 'logo' => ['ImageObject', 'URL'], - 'makesOffer' => ['Offer'], - 'member' => ['Organization', 'Person'], - 'memberOf' => ['Organization', 'ProgramMembership'], - 'naics' => ['Text'], - 'numberOfEmployees' => ['QuantitativeValue'], - 'ownershipFundingInfo' => ['AboutPage', 'CreativeWork', 'Text', 'URL'], - 'owns' => ['OwnershipInfo', 'Product'], - 'parentOrganization' => ['Organization'], - 'publishingPrinciples' => ['CreativeWork', 'URL'], - 'review' => ['Review'], - 'seeks' => ['Demand'], - 'slogan' => ['Text'], - 'sponsor' => ['Organization', 'Person'], - 'subOrganization' => ['Organization'], - 'taxID' => ['Text'], - 'telephone' => ['Text'], - 'unnamedSourcesPolicy' => ['CreativeWork', 'URL'], - 'vatID' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'actionableFeedbackPolicy' => 'For a NewsMediaOrganization or other news-related Organization, a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', - 'address' => 'Physical address of the item.', - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', - 'alumni' => 'Alumni of an organization. Inverse property: alumniOf.', - 'areaServed' => 'The geographic area where a service or offered item is provided. Supersedes serviceArea.', - 'award' => 'An award won by or for this item. Supersedes awards.', - 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', - 'contactPoint' => 'A contact point for a person or organization. Supersedes contactPoints.', - 'correctionsPolicy' => 'For an Organization (e.g. NewsMediaOrganization), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', - 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', - 'dissolutionDate' => 'The date that this organization was dissolved.', - 'diversityPolicy' => 'Statement on diversity policy by an Organization e.g. a NewsMediaOrganization. For a NewsMediaOrganization, a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', - 'diversityStaffingReport' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', - 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', - 'email' => 'Email address.', - 'employee' => 'Someone working for this organization. Supersedes employees.', - 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a NewsMediaOrganization regarding journalistic and publishing practices, or of a Restaurant, a page describing food source policies. In the case of a NewsMediaOrganization, an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', - 'event' => 'Upcoming or past event associated with this place, organization, or action. Supersedes events.', - 'faxNumber' => 'The fax number.', - 'founder' => 'A person who founded this organization. Supersedes founders.', - 'foundingDate' => 'The date that this organization was founded.', - 'foundingLocation' => 'The place where the Organization was founded.', - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', - 'globalLocationNumber' => 'The Global Location Number (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', - 'hasCredential' => 'A credential awarded to the Person or Organization.', - 'hasMerchantReturnPolicy' => 'Indicates a MerchantReturnPolicy that may be applicable. Supersedes hasProductReturnPolicy.', - 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', - 'hasPOS' => 'Points-of-Sales operated by the organization or person.', - 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. Supersedes interactionCount.', - 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', - 'knowsAbout' => 'Of a Person, and less typically of an Organization, to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or JobPosting descriptions.', - 'knowsLanguage' => 'Of a Person, and less typically of an Organization, to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the IETF BCP 47 standard.', - 'legalName' => 'The official name of the organization, e.g. the registered company name.', - 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', - 'location' => 'The location of for example where the event is happening, an organization is located, or where an action takes place.', - 'logo' => 'An associated logo.', - 'makesOffer' => 'A pointer to products or services offered by the organization or person. Inverse property: offeredBy.', - 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. Supersedes members, musicGroupMember. Inverse property: memberOf.', - 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs. Inverse property: member.', - 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', - 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', - 'ownershipFundingInfo' => 'For an Organization (often but not necessarily a NewsMediaOrganization), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the funder is also available and can be used to make basic funder information machine-readable.', - 'owns' => 'Products owned by the organization or person.', - 'parentOrganization' => 'The larger organization that this organization is a subOrganization of, if any. Supersedes branchOf. Inverse property: subOrganization.', - 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. NewsArticle) the principles are those of the party primarily responsible for the creation of the CreativeWork. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a funder) can be expressed using schema.org terminology.', - 'review' => 'A review of the item. Supersedes reviews.', - 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', - 'slogan' => 'A slogan or motto associated with the item.', - '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.', - 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property. Inverse property: parentOrganization.', - 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', - 'telephone' => 'The telephone number.', - 'unnamedSourcesPolicy' => 'For an Organization (typically a NewsMediaOrganization), a statement about policy on use of unnamed sources and the decision process required.', - 'vatID' => 'The Value-added Tax ID of the organization or person.' - ]; - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * For a NewsMediaOrganization or other news-related Organization, a statement - * about public engagement activities (for news media, the newsroom’s), - * including involving the public - digitally or otherwise -- in coverage - * decisions, reporting and activities after publication. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $actionableFeedbackPolicy; - /** - * Physical address of the item. - * - * @var mixed|PostalAddress|string [schema.org types: PostalAddress, Text] - */ - public $address; - /** - * The overall rating, based on a collection of reviews or ratings, of the - * item. - * - * @var AggregateRating [schema.org types: AggregateRating] - */ - public $aggregateRating; - /** - * Alumni of an organization. Inverse property: alumniOf. - * - * @var Person [schema.org types: Person] - */ - public $alumni; - /** - * The geographic area where a service or offered item is provided. Supersedes - * serviceArea. - * - * @var mixed|AdministrativeArea|GeoShape|Place|string [schema.org types: AdministrativeArea, GeoShape, Place, Text] - */ - public $areaServed; - /** - * An award won by or for this item. Supersedes awards. - * - * @var string [schema.org types: Text] - */ - public $award; - /** - * The brand(s) associated with a product or service, or the brand(s) - * maintained by an organization or business person. - * - * @var mixed|Brand|Organization [schema.org types: Brand, Organization] - */ - public $brand; - /** - * A contact point for a person or organization. Supersedes contactPoints. - * - * @var ContactPoint [schema.org types: ContactPoint] - */ - public $contactPoint; - /** - * For an Organization (e.g. NewsMediaOrganization), a statement describing - * (in news media, the newsroom’s) disclosure and correction policy for - * errors. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $correctionsPolicy; - /** - * A relationship between an organization and a department of that - * organization, also described as an organization (allowing different urls, - * logos, opening hours). For example: a store with a pharmacy, or a bakery - * with a cafe. - * - * @var Organization [schema.org types: Organization] - */ - public $department; - /** - * The date that this organization was dissolved. - * - * @var Date [schema.org types: Date] - */ - public $dissolutionDate; - /** - * Statement on diversity policy by an Organization e.g. a - * NewsMediaOrganization. For a NewsMediaOrganization, a statement describing - * the newsroom’s diversity policy on both staffing and sources, typically - * providing staffing data. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $diversityPolicy; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * report on staffing diversity issues. In a news context this might be for - * example ASNE or RTDNA (US) reports, or self-reported. - * - * @var mixed|Article|string [schema.org types: Article, URL] - */ - public $diversityStaffingReport; - /** - * The Dun & Bradstreet DUNS number for identifying an organization or - * business person. - * - * @var string [schema.org types: Text] - */ - public $duns; - /** - * Email address. - * - * @var string [schema.org types: Text] - */ - public $email; - /** - * Someone working for this organization. Supersedes employees. - * - * @var Person [schema.org types: Person] - */ - public $employee; - /** - * Statement about ethics policy, e.g. of a NewsMediaOrganization regarding - * journalistic and publishing practices, or of a Restaurant, a page - * describing food source policies. In the case of a NewsMediaOrganization, an - * ethicsPolicy is typically a statement describing the personal, - * organizational, and corporate standards of behavior expected by the - * organization. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $ethicsPolicy; - /** - * Upcoming or past event associated with this place, organization, or action. - * Supersedes events. - * - * @var Event [schema.org types: Event] - */ - public $event; - /** - * The fax number. - * - * @var string [schema.org types: Text] - */ - public $faxNumber; - /** - * A person who founded this organization. Supersedes founders. - * - * @var Person [schema.org types: Person] - */ - public $founder; - /** - * The date that this organization was founded. - * - * @var Date [schema.org types: Date] - */ - public $foundingDate; - /** - * The place where the Organization was founded. - * - * @var Place [schema.org types: Place] - */ - public $foundingLocation; /** - * A person or organization that supports (sponsors) something through some - * kind of financial contribution. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $funder; - /** - * The Global Location Number (GLN, sometimes also referred to as - * International Location Number or ILN) of the respective organization, - * person, or place. The GLN is a 13-digit number used to identify parties and - * physical locations. - * - * @var string [schema.org types: Text] - */ - public $globalLocationNumber; - /** - * A credential awarded to the Person or Organization. - * - * @var EducationalOccupationalCredential [schema.org types: EducationalOccupationalCredential] - */ - public $hasCredential; - /** - * Indicates a MerchantReturnPolicy that may be applicable. Supersedes - * hasProductReturnPolicy. - * - * @var MerchantReturnPolicy [schema.org types: MerchantReturnPolicy] - */ - public $hasMerchantReturnPolicy; - /** - * Indicates an OfferCatalog listing for this Organization, Person, or - * Service. - * - * @var OfferCatalog [schema.org types: OfferCatalog] - */ - public $hasOfferCatalog; - /** - * Points-of-Sales operated by the organization or person. - * - * @var Place [schema.org types: Place] - */ - public $hasPOS; - /** - * The number of interactions for the CreativeWork using the WebSite or - * SoftwareApplication. The most specific child type of InteractionCounter - * should be used. Supersedes interactionCount. - * - * @var InteractionCounter [schema.org types: InteractionCounter] - */ - public $interactionStatistic; - /** - * The International Standard of Industrial Classification of All Economic - * Activities (ISIC), Revision 4 code for a particular organization, business - * person, or place. - * - * @var string [schema.org types: Text] - */ - public $isicV4; - /** - * Of a Person, and less typically of an Organization, to indicate a topic - * that is known about - suggesting possible expertise but not implying it. We - * do not distinguish skill levels here, or relate this to educational - * content, events, objectives or JobPosting descriptions. - * - * @var mixed|string|Thing|string [schema.org types: Text, Thing, URL] - */ - public $knowsAbout; - /** - * Of a Person, and less typically of an Organization, to indicate a known - * language. We do not distinguish skill levels or - * reading/writing/speaking/signing here. Use language codes from the IETF BCP - * 47 standard. - * - * @var mixed|Language|string [schema.org types: Language, Text] - */ - public $knowsLanguage; - /** - * The official name of the organization, e.g. the registered company name. - * - * @var string [schema.org types: Text] - */ - public $legalName; - /** - * An organization identifier that uniquely identifies a legal entity as - * defined in ISO 17442. - * - * @var string [schema.org types: Text] - */ - public $leiCode; - /** - * The location of for example where the event is happening, an organization - * is located, or where an action takes place. - * - * @var mixed|Place|PostalAddress|string|VirtualLocation [schema.org types: Place, PostalAddress, Text, VirtualLocation] - */ - public $location; - /** - * An associated logo. - * - * @var mixed|ImageObject|string [schema.org types: ImageObject, URL] - */ - public $logo; - /** - * A pointer to products or services offered by the organization or person. - * Inverse property: offeredBy. - * - * @var Offer [schema.org types: Offer] - */ - public $makesOffer; - /** - * A member of an Organization or a ProgramMembership. Organizations can be - * members of organizations; ProgramMembership is typically for individuals. - * Supersedes members, musicGroupMember. Inverse property: memberOf. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] - */ - public $member; - /** - * An Organization (or ProgramMembership) to which this Person or Organization - * belongs. Inverse property: member. - * - * @var mixed|Organization|ProgramMembership [schema.org types: Organization, ProgramMembership] - */ - public $memberOf; - /** - * The North American Industry Classification System (NAICS) code for a - * particular organization or business person. - * - * @var string [schema.org types: Text] - */ - public $naics; - /** - * The number of employees in an organization e.g. business. - * - * @var QuantitativeValue [schema.org types: QuantitativeValue] - */ - public $numberOfEmployees; - /** - * For an Organization (often but not necessarily a NewsMediaOrganization), a - * description of organizational ownership structure; funding and grants. In a - * news/media setting, this is with particular reference to editorial - * independence. Note that the funder is also available and can be used to - * make basic funder information machine-readable. - * - * @var mixed|AboutPage|CreativeWork|string|string [schema.org types: AboutPage, CreativeWork, Text, URL] - */ - public $ownershipFundingInfo; - /** - * Products owned by the organization or person. - * - * @var mixed|OwnershipInfo|Product [schema.org types: OwnershipInfo, Product] - */ - public $owns; - /** - * The larger organization that this organization is a subOrganization of, if - * any. Supersedes branchOf. Inverse property: subOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $parentOrganization; - /** - * The publishingPrinciples property indicates (typically via URL) a document - * describing the editorial principles of an Organization (or individual e.g. - * a Person writing a blog) that relate to their activities as a publisher, - * e.g. ethics or diversity policies. When applied to a CreativeWork (e.g. - * NewsArticle) the principles are those of the party primarily responsible - * for the creation of the CreativeWork. While such policies are most - * typically expressed in natural language, sometimes related information - * (e.g. indicating a funder) can be expressed using schema.org terminology. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $publishingPrinciples; - /** - * A review of the item. Supersedes reviews. - * - * @var Review [schema.org types: Review] - */ - public $review; - /** - * A pointer to products or services sought by the organization or person - * (demand). - * - * @var Demand [schema.org types: Demand] - */ - public $seeks; - /** - * A slogan or motto associated with the item. - * - * @var string [schema.org types: Text] - */ - public $slogan; - /** - * 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. - * - * @var mixed|Organization|Person [schema.org types: Organization, Person] + * @inheritdoc */ - public $sponsor; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionableFeedbackPolicy' => 'For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'alumni' => 'Alumni of an organization.', + 'areaServed' => 'The geographic area where a service or offered item is provided.', + 'award' => 'An award won by or for this item.', + 'awards' => 'Awards won by or for this item.', + 'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.', + 'contactPoint' => 'A contact point for a person or organization.', + 'contactPoints' => 'A contact point for a person or organization.', + 'correctionsPolicy' => 'For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.', + 'department' => 'A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.', + 'description' => 'A description of the item.', + '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.', + 'dissolutionDate' => 'The date that this organization was dissolved.', + 'diversityPolicy' => 'Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.', + 'diversityStaffingReport' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.', + 'duns' => 'The Dun & Bradstreet DUNS number for identifying an organization or business person.', + 'email' => 'Email address.', + 'employee' => 'Someone working for this organization.', + 'employees' => 'People working for this organization.', + 'ethicsPolicy' => 'Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'founder' => 'A person who founded this organization.', + 'founders' => 'A person who founded this organization.', + 'foundingDate' => 'The date that this organization was founded.', + 'foundingLocation' => 'The place where the Organization was founded.', + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasCredential' => 'A credential awarded to the Person or Organization.', + 'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.', + 'hasOfferCatalog' => 'Indicates an OfferCatalog listing for this Organization, Person, or Service.', + 'hasPOS' => 'Points-of-Sales operated by the organization or person.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'interactionStatistic' => 'The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + 'iso6523Code' => 'An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly. ', + '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.', + 'knowsAbout' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.', + 'knowsLanguage' => 'Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).', + 'legalName' => 'The official name of the organization, e.g. the registered company name.', + 'leiCode' => 'An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + 'logo' => 'An associated logo.', + '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.', + 'makesOffer' => 'A pointer to products or services offered by the organization or person.', + 'member' => 'A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.', + 'memberOf' => 'An Organization (or ProgramMembership) to which this Person or Organization belongs.', + 'members' => 'A member of this organization.', + 'naics' => 'The North American Industry Classification System (NAICS) code for a particular organization or business person.', + 'name' => 'The name of the item.', + 'nonprofitStatus' => 'nonprofit Status indicates the legal status of a non-profit organization in its primary place of business.', + 'numberOfEmployees' => 'The number of employees in an organization e.g. business.', + 'ownershipFundingInfo' => 'For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.', + 'owns' => 'Products owned by the organization or person.', + 'parentOrganization' => 'The larger organization that this organization is a [[subOrganization]] of, if any.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publishingPrinciples' => 'The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. ', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'seeks' => 'A pointer to products or services sought by the organization or person (demand).', + 'serviceArea' => 'The geographic area where the service is provided.', + 'slogan' => 'A slogan or motto associated with the item.', + '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.', + 'subOrganization' => 'A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific \'department\' property.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'taxID' => 'The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.', + 'telephone' => 'The telephone number.', + 'unnamedSourcesPolicy' => 'For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.', + 'url' => 'URL of the item.', + 'vatID' => 'The Value-added Tax ID of the organization or person.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * A relationship between two organizations where the first includes the - * second, e.g., as a subsidiary. See also: the more specific 'department' - * property. Inverse property: parentOrganization. - * - * @var Organization [schema.org types: Organization] - */ - public $subOrganization; - /** - * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US - * or the CIF/NIF in Spain. - * - * @var string [schema.org types: Text] - */ - public $taxID; - /** - * The telephone number. - * - * @var string [schema.org types: Text] - */ - public $telephone; /** - * For an Organization (typically a NewsMediaOrganization), a statement about - * policy on use of unnamed sources and the decision process required. - * - * @var mixed|CreativeWork|string [schema.org types: CreativeWork, URL] - */ - public $unnamedSourcesPolicy; - /** - * The Value-added Tax ID of the organization or person. - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $vatID; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['actionableFeedbackPolicy', 'address', 'aggregateRating', 'alumni', 'areaServed', 'award', 'brand', 'contactPoint', 'correctionsPolicy', 'department', 'dissolutionDate', 'diversityPolicy', 'diversityStaffingReport', 'duns', 'email', 'employee', 'ethicsPolicy', 'event', 'faxNumber', 'founder', 'foundingDate', 'foundingLocation', 'funder', 'globalLocationNumber', 'hasCredential', 'hasMerchantReturnPolicy', 'hasOfferCatalog', 'hasPOS', 'interactionStatistic', 'isicV4', 'knowsAbout', 'knowsLanguage', 'legalName', 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'naics', 'numberOfEmployees', 'ownershipFundingInfo', 'owns', 'parentOrganization', 'publishingPrinciples', 'review', 'seeks', 'slogan', 'sponsor', 'subOrganization', 'taxID', 'telephone', 'unnamedSourcesPolicy', 'vatID'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WorkersUnionInterface.php b/src/models/jsonld/WorkersUnionInterface.php new file mode 100644 index 000000000..9b6920b63 --- /dev/null +++ b/src/models/jsonld/WorkersUnionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'actionStatus' => ['ActionStatusType'], + 'additionalType' => ['URL'], + 'agent' => ['Organization', 'Person'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'endTime' => ['DateTime', 'Time'], + 'error' => ['Thing'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'inLanguage' => ['Text', 'Language'], + 'instrument' => ['Thing'], + 'language' => ['Language'], + 'location' => ['PostalAddress', 'Text', 'Place', 'VirtualLocation'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'object' => ['Thing'], + 'participant' => ['Organization', 'Person'], + 'potentialAction' => ['Action'], + 'provider' => ['Organization', 'Person'], + 'result' => ['Thing'], + 'sameAs' => ['URL'], + 'startTime' => ['DateTime', 'Time'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'target' => ['EntryPoint'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'inLanguage' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'actionStatus' => 'Indicates the current disposition of the Action.', + '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.', + 'agent' => 'The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + 'endTime' => 'The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it\'s the time offset of the end of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'error' => 'For failed actions, more information on the cause of the failure.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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]].', + 'instrument' => 'The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.', + 'language' => 'A sub property of instrument. The language used on this action.', + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', + '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.', + 'name' => 'The name of the item.', + 'object' => 'The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn\'t). e.g. John read *a book*.', + 'participant' => 'Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'result' => 'The result produced in the action. e.g. John wrote *a book*.', + '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.', + 'startTime' => 'The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it\'s the time offset of the start of a clip within a larger file. Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'target' => 'Indicates a target EntryPoint for an Action.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'inLanguage' => ['Language', 'Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - '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. See also availableLanguage. Supersedes language.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * 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. See also - * availableLanguage. Supersedes language. - * - * @var mixed|Language|string [schema.org types: Language, Text] + * @inheritdoc */ - public $inLanguage; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['inLanguage'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WriteActionInterface.php b/src/models/jsonld/WriteActionInterface.php new file mode 100644 index 000000000..1594ef689 --- /dev/null +++ b/src/models/jsonld/WriteActionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/WritePermissionInterface.php b/src/models/jsonld/WritePermissionInterface.php new file mode 100644 index 000000000..460bebf77 --- /dev/null +++ b/src/models/jsonld/WritePermissionInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Expected Types - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyExpectedTypes = [ + public function getSchemaPropertyExpectedTypes(): array + { + return [ - ]; + ]; + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ - /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return []; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return []; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/XPathTypeInterface.php b/src/models/jsonld/XPathTypeInterface.php new file mode 100644 index 000000000..73010fd93 --- /dev/null +++ b/src/models/jsonld/XPathTypeInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org Property Descriptions - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyDescriptions = [ - - ]; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } /** - * The Schema.org Google Required Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRequiredSchema = [ - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static protected $_googleRecommendedSchema = [ - ]; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [[], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/XRayInterface.php b/src/models/jsonld/XRayInterface.php new file mode 100644 index 000000000..1db2a61b6 --- /dev/null +++ b/src/models/jsonld/XRayInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalType' => ['URL'], + 'alternateName' => ['Text'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'name' => ['Text'], + 'potentialAction' => ['Action'], + 'sameAs' => ['URL'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'supersededBy' => ['Enumeration', 'Class', 'Property'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'supersededBy' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + '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.', + 'alternateName' => 'An alias for the item.', + 'description' => 'A description of the item.', + '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.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + '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.', + 'name' => 'The name of the item.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + '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.', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'supersededBy' => ['Class', 'Enumeration', 'Property'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * Relates a term (i.e. a property, class or enumeration) to one that - * supersedes it. - * - * @var mixed|Class|Enumeration|Property [schema.org types: Class, Enumeration, Property] + * @inheritdoc */ - public $supersededBy; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['supersededBy'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ZoneBoardingPolicyInterface.php b/src/models/jsonld/ZoneBoardingPolicyInterface.php new file mode 100644 index 000000000..ad2218eda --- /dev/null +++ b/src/models/jsonld/ZoneBoardingPolicyInterface.php @@ -0,0 +1,24 @@ +getSchemaPropertyExpectedTypes()); + } /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array + * @inheritdoc */ - static public $googleRecommendedSchema = []; + public function getSchemaPropertyExpectedTypes(): array + { + return [ + 'additionalProperty' => ['PropertyValue'], + 'additionalType' => ['URL'], + 'address' => ['Text', 'PostalAddress'], + 'aggregateRating' => ['AggregateRating'], + 'alternateName' => ['Text'], + 'amenityFeature' => ['LocationFeatureSpecification'], + 'branchCode' => ['Text'], + 'containedIn' => ['Place'], + 'containedInPlace' => ['Place'], + 'containsPlace' => ['Place'], + 'description' => ['Text'], + 'disambiguatingDescription' => ['Text'], + 'event' => ['Event'], + 'events' => ['Event'], + 'faxNumber' => ['Text'], + 'geo' => ['GeoCoordinates', 'GeoShape'], + 'geoContains' => ['Place', 'GeospatialGeometry'], + 'geoCoveredBy' => ['Place', 'GeospatialGeometry'], + 'geoCovers' => ['GeospatialGeometry', 'Place'], + 'geoCrosses' => ['GeospatialGeometry', 'Place'], + 'geoDisjoint' => ['GeospatialGeometry', 'Place'], + 'geoEquals' => ['Place', 'GeospatialGeometry'], + 'geoIntersects' => ['GeospatialGeometry', 'Place'], + 'geoOverlaps' => ['GeospatialGeometry', 'Place'], + 'geoTouches' => ['Place', 'GeospatialGeometry'], + 'geoWithin' => ['Place', 'GeospatialGeometry'], + 'globalLocationNumber' => ['Text'], + 'hasDriveThroughService' => ['Boolean'], + 'hasMap' => ['URL', 'Map'], + 'identifier' => ['URL', 'Text', 'PropertyValue'], + 'image' => ['URL', 'ImageObject'], + 'isAccessibleForFree' => ['Boolean'], + 'isicV4' => ['Text'], + 'keywords' => ['DefinedTerm', 'Text', 'URL'], + 'latitude' => ['Text', 'Number'], + 'logo' => ['URL', 'ImageObject'], + 'longitude' => ['Number', 'Text'], + 'mainEntityOfPage' => ['CreativeWork', 'URL'], + 'map' => ['URL'], + 'maps' => ['URL'], + 'maximumAttendeeCapacity' => ['Integer'], + 'name' => ['Text'], + 'openingHours' => ['Text'], + 'openingHoursSpecification' => ['OpeningHoursSpecification'], + 'photo' => ['Photograph', 'ImageObject'], + 'photos' => ['ImageObject', 'Photograph'], + 'potentialAction' => ['Action'], + 'publicAccess' => ['Boolean'], + 'review' => ['Review'], + 'reviews' => ['Review'], + 'sameAs' => ['URL'], + 'slogan' => ['Text'], + 'smokingAllowed' => ['Boolean'], + 'specialOpeningHoursSpecification' => ['OpeningHoursSpecification'], + 'subjectOf' => ['Event', 'CreativeWork'], + 'telephone' => ['Text'], + 'tourBookingPage' => ['URL'], + 'url' => ['URL'] + ]; + } - // Public Properties - // ========================================================================= /** - * The Schema.org Property Names - * - * @var array + * @inheritdoc */ - static protected $_schemaPropertyNames = [ - 'openingHours' - ]; + public function getSchemaPropertyDescriptions(): array + { + return [ + 'additionalProperty' => 'A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org. Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ', + '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.', + 'address' => 'Physical address of the item.', + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', + 'alternateName' => 'An alias for the item.', + 'amenityFeature' => 'An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.', + 'branchCode' => 'A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. ', + 'containedIn' => 'The basic containment relation between a place and one that contains it.', + 'containedInPlace' => 'The basic containment relation between a place and one that contains it.', + 'containsPlace' => 'The basic containment relation between a place and another that it contains.', + 'description' => 'A description of the item.', + '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.', + 'event' => 'Upcoming or past event associated with this place, organization, or action.', + 'events' => 'Upcoming or past events associated with this place or organization.', + 'faxNumber' => 'The fax number.', + 'geo' => 'The geo coordinates of the place.', + 'geoContains' => 'Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCoveredBy' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCovers' => 'Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoCrosses' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoDisjoint' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))', + 'geoEquals' => 'Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship)', + 'geoIntersects' => 'Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoOverlaps' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'geoTouches' => 'Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )', + 'geoWithin' => 'Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).', + 'globalLocationNumber' => 'The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.', + 'hasDriveThroughService' => 'Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.', + 'hasMap' => 'A URL to a map of the place.', + '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. ', + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', + 'isicV4' => 'The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.', + '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.', + 'latitude' => 'The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + 'logo' => 'An associated logo.', + 'longitude' => 'The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).', + '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.', + 'map' => 'A URL to a map of the place.', + 'maps' => 'A URL to a map of the place.', + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', + 'name' => 'The name of the item.', + 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. * Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```. * Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: . * If a business is open 7 days a week, then it can be specified as .', + 'openingHoursSpecification' => 'The opening hours of a certain place.', + 'photo' => 'A photograph of this place.', + 'photos' => 'Photographs of this place.', + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', + 'publicAccess' => 'A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value', + 'review' => 'A review of the item.', + 'reviews' => 'Review of the item.', + '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.', + 'slogan' => 'A slogan or motto associated with the item.', + 'smokingAllowed' => 'Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.', + 'specialOpeningHoursSpecification' => 'The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. ', + 'subjectOf' => 'A CreativeWork or Event about this Thing.', + 'telephone' => 'The telephone number.', + 'tourBookingPage' => 'A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.', + 'url' => 'URL of the item.' + ]; + } - // Static Protected Properties - // ========================================================================= - /** - * The Schema.org Property Expected Types - * - * @var array - */ - static protected $_schemaPropertyExpectedTypes = [ - 'openingHours' => ['Text'] - ]; - /** - * The Schema.org Property Descriptions - * - * @var array - */ - static protected $_schemaPropertyDescriptions = [ - 'openingHours' => 'The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas \',\' separating each day. Day or time ranges are specified using a hyphen \'-\'. Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified using 24:00 time. For example, 3pm is specified as 15:00. Here is an example: . If a business is open 7 days a week, then it can be specified as .' - ]; /** - * The Schema.org Google Required Schema for this type - * - * @var array - */ - static protected $_googleRequiredSchema = [ - ]; - /** - * The Schema.org composed Google Recommended Schema for this type - * - * @var array - */ - static protected $_googleRecommendedSchema = [ - ]; - /** - * The general opening hours for a business. Opening hours can be specified as - * a weekly time range, starting with days, then times per day. Multiple days - * can be listed with commas ',' separating each day. Day or time ranges are - * specified using a hyphen '-'. Days are specified using the following - * two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su. Times are specified - * using 24:00 time. For example, 3pm is specified as 15:00. Here is an - * example: . If a business is open 7 - * days a week, then it can be specified as . - * - * @var string [schema.org types: Text] + * @inheritdoc */ - public $openingHours; - - // Public Methods - // ========================================================================= + public function getGoogleRequiredSchema(): array + { + return ['description', 'name']; + } /** * @inheritdoc */ - public function init(): void + public function getGoogleRecommendedSchema(): array { - parent::init(); - self::$schemaPropertyNames = array_merge( - parent::$schemaPropertyNames, - self::$_schemaPropertyNames - ); - - self::$schemaPropertyExpectedTypes = array_merge( - parent::$schemaPropertyExpectedTypes, - self::$_schemaPropertyExpectedTypes - ); - - self::$schemaPropertyDescriptions = array_merge( - parent::$schemaPropertyDescriptions, - self::$_schemaPropertyDescriptions - ); - - self::$googleRequiredSchema = array_merge( - parent::$googleRequiredSchema, - self::$_googleRequiredSchema - ); - - self::$googleRecommendedSchema = array_merge( - parent::$googleRecommendedSchema, - self::$_googleRecommendedSchema - ); + return ['image', 'url']; } /** * @inheritdoc */ - public function rules(): array + public function defineRules(): array { - $rules = parent::rules(); + $rules = parent::defineRules(); $rules = array_merge($rules, [ - [['openingHours'], 'validateJsonSchema'], - [self::$_googleRequiredSchema, 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], - [self::$_googleRecommendedSchema, 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] ]); return $rules; diff --git a/src/models/jsonld/ZooInterface.php b/src/models/jsonld/ZooInterface.php new file mode 100644 index 000000000..461db498a --- /dev/null +++ b/src/models/jsonld/ZooInterface.php @@ -0,0 +1,24 @@ + 'https://www.google.com/ping?sitemap=', - 'bing' => 'https://www.bing.com/webmaster/ping.aspx?sitemap=', ]; // Protected Properties